Commit 591a5745 by BoxuanXu

change wrong code

1 parent 1e511264
Showing with 13 additions and 7 deletions
...@@ -85,14 +85,14 @@ def get_path_from_db(modelid,seetanet_model): ...@@ -85,14 +85,14 @@ def get_path_from_db(modelid,seetanet_model):
#download file from fastdfs #download file from fastdfs
if(stbf_down(graph_name_path,download_path)): if(stbf_down(graph_name_path,download_path)):
logging.info("download params file: %s success" % params_name) logging.info("download params file: %s success" % graph_name)
else: else:
return None,None return None,None
#Driver converter model by params and model graph #Driver converter model by params and model graph
#Run_Converter(params_name,graph_name,seetanet_model) Run_Converter(params_name,graph_name,seetanet_model)
return params_name,graph_name return params_name,graph_name
...@@ -129,6 +129,7 @@ def Dirver_Convert(): ...@@ -129,6 +129,7 @@ def Dirver_Convert():
if stmodel_fid is None: if stmodel_fid is None:
logging.info("upload filed") logging.info("upload filed")
return "false"
else: else:
#remove params file and graph file #remove params file and graph file
...@@ -139,23 +140,28 @@ def Dirver_Convert(): ...@@ -139,23 +140,28 @@ def Dirver_Convert():
except subprocess.CalledProcessError as err: except subprocess.CalledProcessError as err:
logging.info("shell command error!") logging.info("shell command error!")
return "finish" return "false"
logging.info("convert successfully!") logging.info("convert successfully!")
logging.info("Begin Run JenkIn!") logging.info("Begin Run JenkIn!")
J = Jenkins(host, username='shenyizhong', password='shenyizhong') J = Jenkins(host, username='shenyizhong', password='shenyizhong')
job = J['SeetaNetLite-pro'] job = J['SeetaNetLite-pro']
params = "{\'MODEL_ID\': \'" + modelid + "\',\'OUTPUT_LAYER\':\'" + output_layer + "\',\'STMODEL_FID\':\'" + stmodel_fid + "\'}" params = "{\'MODEL_ID\': \'" + modelid + "\',\'OUTPUT_LAYER\':\'" + output_layer + "\',\'STMODEL_FID\':\'" + stmodel_fid + "\'}"
#convert string to dict
params = eval(params) params = eval(params)
job.invoke(block=True,build_params=params) job.invoke(block=True,build_params=params)
return "true"
finally: finally:
curl_atlas_exe.close() curl_atlas_exe.close()
curl_atlas.close() curl_atlas.close()
db_atlas.close() db_atlas.close()
return "finish"
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -407,14 +407,14 @@ def Run_Converter(model_param,model_json,seetanet_model): ...@@ -407,14 +407,14 @@ def Run_Converter(model_param,model_json,seetanet_model):
#args = parser.parse_args() #args = parser.parse_args()
sym, arg_params, aux_params = \ sym, arg_params, aux_params = \
load_checkpoint(model_param, cfg.MODEL_JSON) load_checkpoint(model_param, model_json)
graph = load_graph(model_json) graph = load_graph(model_json)
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')
print(model_param) print(model_param)
print(model_json) print(model_json)
print(seetanet_model) print(seetanet_model)
#converter.convert(seetanet_model) converter.convert(seetanet_model)
logging.info('convert success!!!') logging.info('convert success!!!')
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!