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
7c15d1b7
Commit
7c15d1b7
authored
Nov 29, 2021
by
WenmuZhou
Browse files
change is to does
parent
389e315a
Changes
1
Show 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 @
7c15d1b7
...
@@ -57,7 +57,7 @@ def load_model(config, model, optimizer=None):
...
@@ -57,7 +57,7 @@ def load_model(config, model, optimizer=None):
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
i
s not exists!"
.
format
(
checkpoints
)
"The {}.pdparams
doe
s not exists!"
.
format
(
checkpoints
)
# load params from trained model
# load params from trained model
params
=
paddle
.
load
(
checkpoints
+
'.pdparams'
)
params
=
paddle
.
load
(
checkpoints
+
'.pdparams'
)
...
@@ -106,7 +106,7 @@ def load_pretrained_params(model, path):
...
@@ -106,7 +106,7 @@ def load_pretrained_params(model, path):
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
i
s not exists!"
.
format
(
path
)
"The {}.pdparams
doe
s not exists!"
.
format
(
path
)
params
=
paddle
.
load
(
path
+
'.pdparams'
)
params
=
paddle
.
load
(
path
+
'.pdparams'
)
state_dict
=
model
.
state_dict
()
state_dict
=
model
.
state_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