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
OpenDAS
MMCV
Commits
8eae7779
Unverified
Commit
8eae7779
authored
Dec 18, 2020
by
nicheng0019
Committed by
GitHub
Dec 18, 2020
Browse files
Update checkpoint.py (#722)
parent
3392a4ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
mmcv/runner/checkpoint.py
mmcv/runner/checkpoint.py
+1
-1
No files found.
mmcv/runner/checkpoint.py
View file @
8eae7779
...
...
@@ -256,7 +256,7 @@ def load_checkpoint(model,
state_dict
=
checkpoint
# strip prefix of state_dict
if
list
(
state_dict
.
keys
())[
0
].
startswith
(
'module.'
):
state_dict
=
{
k
[
7
:]:
v
for
k
,
v
in
checkpoint
[
'
state_dict
'
]
.
items
()}
state_dict
=
{
k
[
7
:]:
v
for
k
,
v
in
state_dict
.
items
()}
# load state_dict
load_state_dict
(
model
,
state_dict
,
strict
,
logger
)
return
checkpoint
...
...
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