Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
BoxuanXu
/
FlaskDriverMXNet2SeetaNet
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 591a5745
authored
Aug 08, 2017
by
BoxuanXu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change wrong code
1 parent
1e511264
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
Drive_Converter.py
converter.py
Drive_Converter.py
View file @
591a574
...
@@ -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__'
:
...
...
converter.py
View file @
591a574
...
@@ -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!!!'
)
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment