open-mmlab / mmtracking

OpenMMLab Video Perception Toolbox. It supports Video Object Detection (VID), Multiple Object Tracking (MOT), Single Object Tracking (SOT), Video Instance Segmentation (VIS) with a unified framework.
https://mmtracking.readthedocs.io/en/latest/
Apache License 2.0
3.57k stars 598 forks source link

When I change the motion model of deepsort to optical flow estimation, I get the following error #736

Open gubei528 opened 2 years ago

gubei528 commented 2 years ago

I modified motion = dict(type='FlowNetSimple', img_scale_factor = x) in the config file, I want to know what value should be passed in for x

2022-10-10 14:51:31,000 - mmtrack - INFO - initialize FasterRCNN with init_cfg {'type': 'Pretrained', 'checkpoint': 'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-half-64ee2ed4.pth'} 2022-10-10 14:51:31,000 - mmcv - INFO - load model from: https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-half-64ee2ed4.pth 2022-10-10 14:51:31,000 - mmcv - INFO - load checkpoint from http path: https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-half-64ee2ed4.pth 2022-10-10 14:51:31,157 - mmtrack - INFO - initialize BaseReID with init_cfg {'type': 'Pretrained', 'checkpoint': 'https://download.openmmlab.com/mmtracking/mot/reid/tracktor_reid_r50_iter25245-a452f51f.pth'} 2022-10-10 14:51:31,157 - mmcv - INFO - load model from: https://download.openmmlab.com/mmtracking/mot/reid/tracktor_reid_r50_iter25245-a452f51f.pth 2022-10-10 14:51:31,157 - mmcv - INFO - load checkpoint from http path: https://download.openmmlab.com/mmtracking/mot/reid/tracktor_reid_r50_iter25245-a452f51f.pth 2022-10-10 14:51:31,242 - mmcv - WARNING - The model and loaded state dict do not match exactly

missing keys in source state_dict: head.bn.weight, head.bn.bias, head.bn.running_mean, head.bn.running_var, head.classifier.weight, head.classifier.bias

Warning: The model doesn't have classes [ ] 0/8, elapsed: 0s, ETA:Traceback (most recent call last): File "demo/demo_mot_vis.py", line 103, in main() File "demo/demo_mot_vis.py", line 78, in main result = inference_mot(model, img, frame_id=i) File "/home/ljh/Code/track/mmtracking/mmtrack/apis/inference.py", line 122, in inference_mot result = model(return_loss=False, rescale=True, data) File "/home/ljh/anaconda3/envs/mmtrack/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, *kwargs) File "/home/ljh/anaconda3/envs/mmtrack/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 116, in new_func return old_func(args, kwargs) File "/home/ljh/Code/track/mmtracking/mmtrack/models/mot/base.py", line 136, in forward return self.forward_test(img, img_metas, kwargs) File "/home/ljh/Code/track/mmtracking/mmtrack/models/mot/base.py", line 113, in forward_test return self.simple_test(imgs[0], img_metas[0], kwargs) File "/home/ljh/Code/track/mmtracking/mmtrack/models/mot/deep_sort.py", line 128, in simple_test *kwargs) File "/home/ljh/anaconda3/envs/mmtrack/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 205, in new_func return old_func(args, **kwargs) File "/home/ljh/Code/track/mmtracking/mmtrack/models/trackers/sort_tracker.py", line 214, in track frame_ids=frame_id) File "/home/ljh/Code/track/mmtracking/mmtrack/models/trackers/base_tracker.py", line 91, in update self.init_track(id, obj) File "/home/ljh/Code/track/mmtracking/mmtrack/models/trackers/sort_tracker.py", line 69, in init_track self.tracks[id].mean, self.tracks[id].covariance = self.kf.initiate( File "/home/ljh/anaconda3/envs/mmtrack/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1178, in getattr type(self).name, name)) AttributeError: 'FlowNetSimple' object has no attribute 'initiate'

pixeli99 commented 2 years ago

In my opinion, we can't make such changes directly. At present, SORT needs to be used together with Kalman filter.