Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError in reid checkpoint #79

Closed
2448845600 opened this issue Jan 6, 2021 · 2 comments
Closed

KeyError in reid checkpoint #79

2448845600 opened this issue Jan 6, 2021 · 2 comments

Comments

@2448845600
Copy link
Contributor

The reid checkpoint loss keyworks "meta". so when I used model with reid checkpoint, it is wrong. For example:

$ python demo/demo_mot.py configs/mot/deepsort/deepsort_faster-rcnn_fpn_4e_mot17-private-half.py --input demo/demo.mp4 --output mot.mp4
2021-01-06 19:52:33,660 - mmtrack - INFO - load detector from: checkpoints/fasterrcnn_r50_fpn_4e_mot17-half-64ee2ed4.pth
2021-01-06 19:52:33,861 - mmtrack - INFO - load reid from:checkpoints/reid/tracktor_reid_r50_iter25245-a452f51f.pth
Traceback (most recent call last):
  File "demo/demo_mot.py", line 88, in <module>
    main()
  File "demo/demo_mot.py", line 57, in main
    model = init_model(args.config, args.checkpoint, device=args.device)
  File "/home/smile/mmtracking/mmtrack/apis/inference.py", line 34, in init_model
    model = build_model(config.model)
  File "/home/smile/mmtracking/mmtrack/models/builder.py", line 69, in build_model
    return build(cfg, MODELS)
  File "/home/smile/mmtracking/mmtrack/models/builder.py", line 34, in build
    return build_from_cfg(cfg, registry, default_args)
  File "/home/smile/tools/mmcv/mmcv/utils/registry.py", line 171, in build_from_cfg
    return obj_cls(**args)
  File "/home/smile/mmtracking/mmtrack/models/mot/deep_sort.py", line 35, in __init__
    self.init_weights(pretrains)
  File "/home/smile/mmtracking/mmtrack/models/mot/deep_sort.py", line 49, in init_weights
    self.init_module('reid', pretrain['reid'])
  File "/home/smile/mmtracking/mmtrack/models/mot/base.py", line 35, in init_module
    if 'CLASSES' in checkpoint['meta']:
KeyError: 'meta'

And:

>>> model = torch.load("checkpoints/reid/tracktor_reid_r50_iter25245-a452f51f.pth")
>>> model["meta"]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'meta'

So I think the reid checkpoint you release is broken.

@OceanPang
Copy link
Collaborator

Thanks for the report.

We will check it later and fix the problem.

@OceanPang
Copy link
Collaborator

Fixed in #80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants