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
86d469d0
Unverified
Commit
86d469d0
authored
Jul 05, 2021
by
Double_V
Committed by
GitHub
Jul 05, 2021
Browse files
Merge pull request #3232 from bingooo/dygraph
fix bug
parents
605bf838
61cee7e6
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 @
86d469d0
...
@@ -91,14 +91,14 @@ def init_model(config, model, optimizer=None, lr_scheduler=None):
...
@@ -91,14 +91,14 @@ def init_model(config, model, optimizer=None, lr_scheduler=None):
def
load_dygraph_params
(
config
,
model
,
logger
,
optimizer
):
def
load_dygraph_params
(
config
,
model
,
logger
,
optimizer
):
ckp
=
config
[
'Global'
][
'checkpoints'
]
ckp
=
config
[
'Global'
][
'checkpoints'
]
if
ckp
and
os
.
path
.
exists
(
ckp
):
if
ckp
and
os
.
path
.
exists
(
ckp
+
".pdparams"
):
pre_best_model_dict
=
init_model
(
config
,
model
,
optimizer
)
pre_best_model_dict
=
init_model
(
config
,
model
,
optimizer
)
return
pre_best_model_dict
return
pre_best_model_dict
else
:
else
:
pm
=
config
[
'Global'
][
'pretrained_model'
]
pm
=
config
[
'Global'
][
'pretrained_model'
]
if
pm
is
None
:
if
pm
is
None
:
return
{}
return
{}
if
not
os
.
path
.
exists
(
pm
)
or
not
os
.
path
.
exists
(
pm
+
".pdparams"
):
if
not
os
.
path
.
exists
(
pm
)
and
not
os
.
path
.
exists
(
pm
+
".pdparams"
):
logger
.
info
(
f
"The pretrained_model
{
pm
}
does not exists!"
)
logger
.
info
(
f
"The pretrained_model
{
pm
}
does not exists!"
)
return
{}
return
{}
pm
=
pm
if
pm
.
endswith
(
'.pdparams'
)
else
pm
+
'.pdparams'
pm
=
pm
if
pm
.
endswith
(
'.pdparams'
)
else
pm
+
'.pdparams'
...
...
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