NirAharon / BoT-SORT

BoT-SORT: Robust Associations Multi-Pedestrian Tracking
MIT License
910 stars 419 forks source link

Not enough values to unpack for reid #2

Closed Kerwin0621 closed 2 years ago

Kerwin0621 commented 2 years ago

python tools/demo.py video -f yolox/exps/example/mot/yolox_x_mix_det.py -c yolox/pretrained/bytetrack_x_mot17.pth.tar --path ./videos/palace.mp4 --with-reid --fp16 --fuse --save_result 2022-07-06 00:46:58.875 | INFO | main:main:305 - Args: Namespace(ablation=False, appearance_thresh=0.2, aspect_ratio_thresh=1.6, camid=0, ckpt='yolox/pretrained/bytetrack_x_mot17.pth.tar', cmc_method='orb', conf=None, demo='video', device=device(type='cuda'), exp_file='yolox/exps/example/mot/yolox_x_mix_det.py', experiment_name='yolox_x_mix_det', fast_reid_config='fast_reid/configs/MOT17/sbs_S50.yml', fast_reid_weights='fast_reid/pretrained/mot17_ablation_sbs_S50.pth', fp16=True, fps=30, fuse=True, fuse_score=False, match_thresh=0.8, min_box_area=10, mot20=True, name=None, new_track_thresh=0.7, nms=None, path='./videos/palace.mp4', proximity_thresh=0.5, save_result=True, track_buffer=30, track_high_thresh=0.6, track_low_thresh=0.1, trt=False, tsize=None, with_reid=True) /home/kerwin/miniconda3/envs/FairMOT/lib/python3.8/site-packages/torch/functional.py:568: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /opt/conda/conda-bld/pytorch_1646755903507/work/aten/src/ATen/native/TensorShape.cpp:2228.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] 2022-07-06 00:47:01.318 | INFO | main:main:315 - Model Summary: Params: 99.00M, Gflops: 793.21 2022-07-06 00:47:01.320 | INFO | main:main:323 - loading checkpoint 2022-07-06 00:47:01.808 | INFO | main:main:327 - loaded checkpoint done. 2022-07-06 00:47:01.808 | INFO | main:main:330 - Fusing model... /home/kerwin/miniconda3/envs/FairMOT/lib/python3.8/site-packages/torch/_tensor.py:1104: UserWarning: The .grad attribute of a Tensor that is not a leaf Tensor is being accessed. Its .grad attribute won't be populated during autograd.backward(). If you indeed want the .grad field to be populated for a non-leaf Tensor, use .retain_grad() on the non-leaf Tensor. If you access the non-leaf Tensor by mistake, make sure you access the leaf Tensor instead. See github.com/pytorch/pytorch/pull/30531 for more informations. (Triggered internally at /opt/conda/conda-bld/pytorch_1646755903507/work/build/aten/src/ATen/core/TensorBody.h:475.) return self._grad 2022-07-06 00:47:02.450 | INFO | main:imageflow_demo:228 - video save_path is ./YOLOX_outputs/yolox_x_mix_det/track_vis/2022_07_06_00_47_02/palace.mp4 Skip loading parameter 'heads.weight' to the model due to incompatible shapes: (487, 2048) in the checkpoint but (0, 2048) in the model! You might want to double check if this is expected. 2022-07-06 00:47:02.899 | INFO | main:imageflow_demo:238 - Processing frame 0 (100000.00 fps) Traceback (most recent call last): File "tools/demo.py", line 366, in main(exp, args) File "tools/demo.py", line 354, in main imageflow_demo(predictor, vis_folder, current_time, args) File "tools/demo.py", line 251, in imageflow_demo online_targets = tracker.update(detections, img_info) File "/home/kerwin/temp/BoT-SORT/tracker/bot_sort.py", line 256, in update features_keep = self.encoder.inference(img, dets) File "/home/kerwin/temp/BoT-SORT/fast_reid/fast_reidinterfece.py", line 75, in inference H, W, = np.shape(image) ValueError: not enough values to unpack (expected 3, got 0)

LijiaDong1220 commented 2 years ago

@Kerwin0621 Because in "tools/demo/py",line 251: the "img_info" is the type of dictionary, the subsequent reasoning process will report errors. Here is my solution: in tracker/bot_sort.py, line 230:

def update(self, output_results, img):
        img = img['raw_img']  ### add this, for extract the raw image
        self.frame_id += 1
        activated_starcks = []
....
NirAharon commented 2 years ago

Thank you, demo.py was updated to fix this problem.