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
ModelZoo
SOLOv2-pytorch
Commits
a6857292
Commit
a6857292
authored
May 29, 2019
by
Vladislav Sovrasov
Committed by
Kai Chen
May 29, 2019
Browse files
Fix acces to a wrong key in checkpoint (#734)
parent
0d9dbcc4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
mmdet/apis/inference.py
mmdet/apis/inference.py
+1
-1
tools/train.py
tools/train.py
+1
-1
No files found.
mmdet/apis/inference.py
View file @
a6857292
...
@@ -34,7 +34,7 @@ def init_detector(config, checkpoint=None, device='cuda:0'):
...
@@ -34,7 +34,7 @@ def init_detector(config, checkpoint=None, device='cuda:0'):
if
checkpoint
is
not
None
:
if
checkpoint
is
not
None
:
checkpoint
=
load_checkpoint
(
model
,
checkpoint
)
checkpoint
=
load_checkpoint
(
model
,
checkpoint
)
if
'CLASSES'
in
checkpoint
[
'meta'
]:
if
'CLASSES'
in
checkpoint
[
'meta'
]:
model
.
CLASSES
=
checkpoint
[
'meta'
][
'
classes
'
]
model
.
CLASSES
=
checkpoint
[
'meta'
][
'
CLASSES
'
]
else
:
else
:
warnings
.
warn
(
'Class names are not saved in the checkpoint
\'
s '
warnings
.
warn
(
'Class names are not saved in the checkpoint
\'
s '
'meta data, use COCO classes by default.'
)
'meta data, use COCO classes by default.'
)
...
...
tools/train.py
View file @
a6857292
...
@@ -79,7 +79,7 @@ def main():
...
@@ -79,7 +79,7 @@ def main():
cfg
.
checkpoint_config
.
meta
=
dict
(
cfg
.
checkpoint_config
.
meta
=
dict
(
mmdet_version
=
__version__
,
mmdet_version
=
__version__
,
config
=
cfg
.
text
,
config
=
cfg
.
text
,
classes
=
train_dataset
.
CLASSES
)
CLASSES
=
train_dataset
.
CLASSES
)
# add an attribute for visualization convenience
# add an attribute for visualization convenience
model
.
CLASSES
=
train_dataset
.
CLASSES
model
.
CLASSES
=
train_dataset
.
CLASSES
train_detector
(
train_detector
(
...
...
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