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
4d775dc9
Commit
4d775dc9
authored
Nov 09, 2020
by
WenmuZhou
Browse files
rc版本适配
parent
44840726
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 @
4d775dc9
...
...
@@ -68,11 +68,11 @@ def load_dygraph_pretrain(model, logger, path=None, load_static_weights=False):
param_state_dict
[
key
]
=
pre_state_dict
[
weight_name
]
else
:
param_state_dict
[
key
]
=
model_dict
[
key
]
model
.
set_dict
(
param_state_dict
)
model
.
set_
state_
dict
(
param_state_dict
)
return
param_state_dict
,
optim_state_dict
=
paddle
.
load
(
path
)
model
.
set_dict
(
param_state_dict
)
param_state_dict
=
paddle
.
load
(
path
+
'.pdparams'
)
model
.
set_
state_
dict
(
param_state_dict
)
return
...
...
@@ -91,7 +91,7 @@ def init_model(config, model, logger, optimizer=None, lr_scheduler=None):
"Given dir {}.pdopt not exist."
.
format
(
checkpoints
)
para_dict
=
paddle
.
load
(
checkpoints
+
'.pdparams'
)
opti_dict
=
paddle
.
load
(
checkpoints
+
'.pdopt'
)
model
.
set_dict
(
para_dict
)
model
.
set_
state_
dict
(
para_dict
)
if
optimizer
is
not
None
:
optimizer
.
set_state_dict
(
opti_dict
)
...
...
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