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
f7111d7b
Unverified
Commit
f7111d7b
authored
Aug 04, 2020
by
littletomatodonkey
Committed by
GitHub
Aug 04, 2020
Browse files
Merge pull request #467 from BeyondYourself/develop
add a necessary check for checkpoints
parents
f7b5edcc
a4abf132
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
ppocr/utils/save_load.py
ppocr/utils/save_load.py
+8
-3
No files found.
ppocr/utils/save_load.py
View file @
f7111d7b
...
@@ -109,9 +109,14 @@ def init_model(config, program, exe):
...
@@ -109,9 +109,14 @@ def init_model(config, program, exe):
"""
"""
checkpoints
=
config
[
'Global'
].
get
(
'checkpoints'
)
checkpoints
=
config
[
'Global'
].
get
(
'checkpoints'
)
if
checkpoints
:
if
checkpoints
:
path
=
checkpoints
if
os
.
path
.
exists
(
checkpoints
+
'.pdparams'
):
fluid
.
load
(
program
,
path
,
exe
)
path
=
checkpoints
logger
.
info
(
"Finish initing model from {}"
.
format
(
path
))
fluid
.
load
(
program
,
path
,
exe
)
logger
.
info
(
"Finish initing model from {}"
.
format
(
path
))
else
:
raise
ValueError
(
"Model checkpoints {} does not exists,"
"check if you lost the file prefix."
.
format
(
checkpoints
+
'.pdparams'
))
pretrain_weights
=
config
[
'Global'
].
get
(
'pretrain_weights'
)
pretrain_weights
=
config
[
'Global'
].
get
(
'pretrain_weights'
)
if
pretrain_weights
:
if
pretrain_weights
:
...
...
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