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

TypeError: DeepSORT: __init__() got an unexpected keyword argument 'backbone' #485

Closed
castrovictor opened this issue Apr 7, 2022 · 4 comments

Comments

@castrovictor
Copy link

Describe the bug

I am trying to train a tracker with Retina as detector, using the MOT dataset. I have followed the tutorials and tried to understand the configs, but I can't still make it work. I compare with what is done in the examples and the configs provided, but still does not work. When I try to train, I get the following error:
TypeError: DeepSORT: __init__() got an unexpected keyword argument 'backbone'

Reproduction

  1. What command or script did you run?
python tools/train.py /home/ubuntu/mmtracking/configs/mot/deepsort/sort_retinanet_r50_fpn_4e_mot17-private.py
  1. Did you make any modifications on the code or config? Did you understand what you have modified?
    Yes, I understand what I have modified. here I share the configs:
    /home/ubuntu/mmtracking/configs/mot/deepsort/sort_retinanet_r50_fpn_4e_mot17-private-half.py -> https://codeshare.io/6pJoqg
    /home/ubuntu/mmtracking/configs/mot/deepsort/sort_retinanet_r50_fpn_4e_mot17-private.py -> https://codeshare.io/mpDXe1
    Detection model, works ok in MMDetector: configs/models/retina_r50_mod.py

latest.pth is the checkpoint/trained model generated with MMDetector and the config of retina_50 given above.

  1. What dataset did you use and what task did you run?
    MOT

Environment
Environment exactly as in the installation guide.

Error traceback
If applicable, paste the error trackback here.

2022-04-07 12:42:58,405 - mmtrack - INFO - Set random seed to 484183397, deterministic: False
Traceback (most recent call last):
  File "/home/ubuntu/anaconda3/envs/openmmlab/lib/python3.7/site-packages/mmcv/utils/registry.py", line 52, in build_from_cfg
    return obj_cls(**args)
TypeError: __init__() got an unexpected keyword argument 'backbone'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tools/train.py", line 210, in <module>
    main()
  File "tools/train.py", line 182, in main
    model = build_model(cfg.model)
  File "/home/ubuntu/mmtracking/mmtrack/models/builder.py", line 35, in build_model
    return MODELS.build(cfg)
  File "/home/ubuntu/anaconda3/envs/openmmlab/lib/python3.7/site-packages/mmcv/utils/registry.py", line 212, in build
    return self.build_func(*args, **kwargs, registry=self)
  File "/home/ubuntu/anaconda3/envs/openmmlab/lib/python3.7/site-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg
    return build_from_cfg(cfg, registry, default_args)
  File "/home/ubuntu/anaconda3/envs/openmmlab/lib/python3.7/site-packages/mmcv/utils/registry.py", line 55, in build_from_cfg
    raise type(e)(f'{obj_cls.__name__}: {e}')
TypeError: DeepSORT: __init__() got an unexpected keyword argument 'backbone'

@JingweiZhang12
Copy link
Collaborator

Hi, different from the model configs in mmdetection, the detector model in mmtracking needs to be wrapped into a dict like: dict(detector=dict('type='RetinaNet', backbone=...)).
You can refer to this:
https://github.com/open-mmlab/mmtracking/blob/master/configs/_base_/models/faster_rcnn_r50_fpn.py#L2

@castrovictor
Copy link
Author

castrovictor commented Apr 11, 2022

Hi, different from the model configs in mmdetection, the detector model in mmtracking needs to be wrapped into a dict like: dict(detector=dict('type='RetinaNet', backbone=...)). You can refer to this: https://github.com/open-mmlab/mmtracking/blob/master/configs/_base_/models/faster_rcnn_r50_fpn.py#L2

Hi. Thank you for your response. I read the configs but I didn't notice that detail. Now I do not get that error (I solved another one I got). Not it should work, but I get NotImplementedError: Please train 'detector' and 'reid' models firstly, then inference with SORT/DeepSORT.

I provided the checkpoint produced by the mmdetector. And refering to the implemenation of deepsort y mmtracker, it seems that the tracker does not need to be trained, but train detector and reid and the inference directly. Is this correct?

@Seerkfang
Copy link
Collaborator

Yes, you only need to train the detector and ReID model.

@castrovictor
Copy link
Author

Yes, you only need to train the detector and ReID model.

Thanks for the quick response! Dealing with this now, it seems the dependencies have some problems/bugs (at least in my machine)

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

3 participants