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 b794915d
authored
Aug 08, 2017
by
BoxuanXu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
editer wrong code
1 parent
ebc6f09b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
Drive_Converter.py
Drive_Converter.py
View file @
b794915
...
...
@@ -102,22 +102,20 @@ def get_path_from_db(modelid,seetanet_model):
def
upload_filetoFastDFS
(
params_name
,
graph_name
,
seetanet_model
):
#upload seetanet file to fastdfs
s
eetanet_model_
id
=
stbf_up
(
seetanet_model
)
if
(
s
eetanet_model_
id
):
logging
.
info
(
"upload seetanet file success,seetanet model_id is
%
s"
%
s
eetanet_model_
id
)
s
tmodel_f
id
=
stbf_up
(
seetanet_model
)
if
(
s
tmodel_f
id
):
logging
.
info
(
"upload seetanet file success,seetanet model_id is
%
s"
%
s
tmodel_f
id
)
else
:
logging
.
info
(
"upload seetanet file failed!"
)
return
None
return
s
eetanet_model_
id
return
s
tmodel_f
id
def
update_pkg_info_db
(
sdk_fid
,
seetanet_model_id
):
#seetanet_model_id = "group2/M00/00/04/wKgB61l-xXKARFT0AAANtlf6yRo13.json"
def
update_pkg_info_db
(
modelid
,
sdk_fid
,
stmodel_fid
):
#update pkg info table
logging
.
info
(
"begin insert model_id ,sdk_fid,mxnet_modelid into pkg_info table"
)
sql_cmd
=
"insert into seetaAtlas.pkg_info (modelid,sdk_fid,stmodel_fid) values("
+
str
(
m
xnet_modelid
)
+
",
\'
"
+
sdk_fid
+
"
\'
,
\'
"
+
seetanet_model_
id
+
"
\'
)"
sql_cmd
=
"insert into seetaAtlas.pkg_info (modelid,sdk_fid,stmodel_fid) values("
+
str
(
m
odelid
)
+
",
\'
"
+
sdk_fid
+
"
\'
,
\'
"
+
stmodel_f
id
+
"
\'
)"
curl_atlas_exe
.
execute
(
sql_cmd
)
db_atlas
.
commit
()
...
...
@@ -139,13 +137,13 @@ def Dirver_Convert():
if
params_name
is
None
or
graph_name
is
None
:
logging
.
info
(
"get wrong params file"
)
else
:
s
eetanet_model_
id
=
upload_filetoFastDFS
(
params_name
,
graph_name
,
seetanet_model
)
s
tmodel_f
id
=
upload_filetoFastDFS
(
params_name
,
graph_name
,
seetanet_model
)
if
s
eetanet_model_
id
is
None
:
if
s
tmodel_f
id
is
None
:
logging
.
info
(
"upload filed"
)
else
:
sdk_fid
=
"group2/M00/00/04/wKgB61l-xXKARFT0AAANtlf6yRo13.json"
update_pkg_info_db
(
sdk_fid
,
seetanet_model_
id
)
update_pkg_info_db
(
modelid
,
sdk_fid
,
stmodel_f
id
)
logging
.
info
(
"successfully,Finish!"
)
finally
:
...
...
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