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
7fd8d6a2
Unverified
Commit
7fd8d6a2
authored
May 24, 2021
by
Double_V
Committed by
GitHub
May 24, 2021
Browse files
Merge pull request #2878 from YukSing12/patch-1
Update save_load.py
parents
b7815182
d1a7d35c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
ppocr/utils/save_load.py
ppocr/utils/save_load.py
+4
-4
No files found.
ppocr/utils/save_load.py
View file @
7fd8d6a2
...
...
@@ -80,9 +80,9 @@ def init_model(config, model, logger, optimizer=None, lr_scheduler=None):
"""
load model from checkpoint or pretrained_model
"""
glo
a
bl_config
=
config
[
'Global'
]
checkpoints
=
glo
a
bl_config
.
get
(
'checkpoints'
)
pretrained_model
=
glo
a
bl_config
.
get
(
'pretrained_model'
)
glob
a
l_config
=
config
[
'Global'
]
checkpoints
=
glob
a
l_config
.
get
(
'checkpoints'
)
pretrained_model
=
glob
a
l_config
.
get
(
'pretrained_model'
)
best_model_dict
=
{}
if
checkpoints
:
assert
os
.
path
.
exists
(
checkpoints
+
".pdparams"
),
\
...
...
@@ -105,7 +105,7 @@ def init_model(config, model, logger, optimizer=None, lr_scheduler=None):
logger
.
info
(
"resume from {}"
.
format
(
checkpoints
))
elif
pretrained_model
:
load_static_weights
=
glo
a
bl_config
.
get
(
'load_static_weights'
,
False
)
load_static_weights
=
glob
a
l_config
.
get
(
'load_static_weights'
,
False
)
if
not
isinstance
(
pretrained_model
,
list
):
pretrained_model
=
[
pretrained_model
]
if
not
isinstance
(
load_static_weights
,
list
):
...
...
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