Commit 36c2f964 by BoxuanXu

fix bug

1 parent 9f92a31d
...@@ -34,5 +34,8 @@ class GProgress_Var: ...@@ -34,5 +34,8 @@ class GProgress_Var:
def Post_return(self): def Post_return(self):
post_return = { "posttype": self.posttype, "progress" : self.progress, "pool_id": self.pool_id, "err_msg": self.err_msg } post_return = { "posttype": self.posttype, "progress" : self.progress, "pool_id": self.pool_id, "err_msg": self.err_msg }
print(post_return) print(post_return)
requests.post(post_url, data=post_return) try:
requests.post(post_url, data=post_return)
except requests.RequestException as e:
print(e)
DATA_NAME = 'data' DATA_NAME = 'data_0'
OUTPUT_LAYER = '' OUTPUT_LAYER = ''
#MODEL_PARAM = '/home/dev01/workshop/projects/MXNet2SeetaNet/model-0015.params' #MODEL_PARAM = '/home/dev01/workshop/projects/MXNet2SeetaNet/model-0015.params'
#MODEL_JSON = '/home/dev01/workshop/projects/MXNet2SeetaNet/model-symbol.json' #MODEL_JSON = '/home/dev01/workshop/projects/MXNet2SeetaNet/model-symbol.json'
......
...@@ -427,6 +427,8 @@ def Run_Converter(model_param,model_json,seetanet_model,GP): ...@@ -427,6 +427,8 @@ def Run_Converter(model_param,model_json,seetanet_model,GP):
sym, arg_params, aux_params = \ sym, arg_params, aux_params = \
load_checkpoint(model_param, model_json) load_checkpoint(model_param, model_json)
graph = load_graph(model_json) graph = load_graph(model_json)
if graph is None:
return None
converter = Converter(graph, arg_params, aux_params) converter = Converter(graph, arg_params, aux_params)
logging.info('start to convert model parameters') logging.info('start to convert model parameters')
converter.convert(seetanet_model,GP) converter.convert(seetanet_model,GP)
......
...@@ -214,6 +214,7 @@ def construct_graph(json_file): ...@@ -214,6 +214,7 @@ def construct_graph(json_file):
def load_graph(json_file): def load_graph(json_file):
try:
logging.info('construct graph') logging.info('construct graph')
graph = construct_graph(json_file) graph = construct_graph(json_file)
logging.info('remove Flatten layer') logging.info('remove Flatten layer')
...@@ -226,6 +227,8 @@ def load_graph(json_file): ...@@ -226,6 +227,8 @@ def load_graph(json_file):
set_idx(graph) set_idx(graph)
logging.info('load graph over') logging.info('load graph over')
return graph return graph
except Exception, e:
return None
# if __name__ == '__main__': # if __name__ == '__main__':
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!