Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
7f1badf7
Commit
7f1badf7
authored
Nov 24, 2021
by
WenmuZhou
Browse files
pair param with key when load trained model params
parent
4a6f7cec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
ppocr/utils/save_load.py
ppocr/utils/save_load.py
+2
-2
No files found.
ppocr/utils/save_load.py
View file @
7f1badf7
...
@@ -54,7 +54,7 @@ def load_model(config, model, optimizer=None):
...
@@ -54,7 +54,7 @@ def load_model(config, model, optimizer=None):
pretrained_model
=
global_config
.
get
(
'pretrained_model'
)
pretrained_model
=
global_config
.
get
(
'pretrained_model'
)
best_model_dict
=
{}
best_model_dict
=
{}
if
checkpoints
:
if
checkpoints
:
if
checkpoints
.
endswith
(
'pdparams'
):
if
checkpoints
.
endswith
(
'
.
pdparams'
):
checkpoints
=
checkpoints
.
replace
(
'.pdparams'
,
''
)
checkpoints
=
checkpoints
.
replace
(
'.pdparams'
,
''
)
assert
os
.
path
.
exists
(
checkpoints
+
".pdparams"
),
\
assert
os
.
path
.
exists
(
checkpoints
+
".pdparams"
),
\
"The {}.pdparams does not exists!"
.
format
(
checkpoints
)
"The {}.pdparams does not exists!"
.
format
(
checkpoints
)
...
@@ -97,7 +97,7 @@ def load_model(config, model, optimizer=None):
...
@@ -97,7 +97,7 @@ def load_model(config, model, optimizer=None):
def
load_pretrained_params
(
model
,
path
):
def
load_pretrained_params
(
model
,
path
):
logger
=
get_logger
()
logger
=
get_logger
()
if
path
.
endswith
(
'pdparams'
):
if
path
.
endswith
(
'
.
pdparams'
):
path
=
path
.
replace
(
'.pdparams'
,
''
)
path
=
path
.
replace
(
'.pdparams'
,
''
)
assert
os
.
path
.
exists
(
path
+
".pdparams"
),
\
assert
os
.
path
.
exists
(
path
+
".pdparams"
),
\
"The {}.pdparams does not exists!"
.
format
(
path
)
"The {}.pdparams does not exists!"
.
format
(
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment