Skip to content

Commit a685729

Browse files
sovrasovhellock
authored andcommitted
Fix acces to a wrong key in checkpoint (open-mmlab#734)
1 parent 0d9dbcc commit a685729

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mmdet/apis/inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def init_detector(config, checkpoint=None, device='cuda:0'):
3434
if checkpoint is not None:
3535
checkpoint = load_checkpoint(model, checkpoint)
3636
if 'CLASSES' in checkpoint['meta']:
37-
model.CLASSES = checkpoint['meta']['classes']
37+
model.CLASSES = checkpoint['meta']['CLASSES']
3838
else:
3939
warnings.warn('Class names are not saved in the checkpoint\'s '
4040
'meta data, use COCO classes by default.')

tools/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def main():
7979
cfg.checkpoint_config.meta = dict(
8080
mmdet_version=__version__,
8181
config=cfg.text,
82-
classes=train_dataset.CLASSES)
82+
CLASSES=train_dataset.CLASSES)
8383
# add an attribute for visualization convenience
8484
model.CLASSES = train_dataset.CLASSES
8585
train_detector(

0 commit comments

Comments
 (0)