(yolo) nu@nu:~/DATA/yolox_deepsort/YOLOX$ python tools/demo.py image -n yolox-s -c /home/nu/DATA/yolox_deepsort/YOLOX/WEIGHTS/yolox_s.pth --path assets/dog.jpg --conf 0.25 --nms 0.45 --tsize 640 --save_result --device gpu
2022-07-15 11:00:49.627 | INFO | __main__:main:259 - Args: Namespace(camid=0, ckpt='/home/nu/DATA/yolox_deepsort/YOLOX/WEIGHTS/yolox_s.pth', conf=0.25, demo='image', device='gpu', exp_file=None, experiment_name='yolox_s', fp16=False, fuse=False, legacy=False, name='yolox-s', nms=0.45, path='assets/dog.jpg', save_result=True, trt=False, tsize=640)
/home/nu/anaconda3/envs/yolo/lib/python3.7/site-packages/torch/functional.py:478: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:2895.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
2022-07-15 11:00:49.766 | INFO | __main__:main:269 - Model Summary: Params: 8.94M, Gflops: 26.65
2022-07-15 11:00:51.275 | INFO | __main__:main:282 - loading checkpoint
Traceback (most recent call last):
File "tools/demo.py", line 320, in <module>
main(exp, args)
File "tools/demo.py", line 285, in main
model.load_state_dict(ckpt["model"])
File "/home/nu/anaconda3/envs/yolo/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1605, in load_state_dict
self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for YOLOX:
size mismatch for head.cls_preds.0.weight: copying a param with shape torch.Size([80, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([7, 128, 1, 1]).
size mismatch for head.cls_preds.0.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([7]).
size mismatch for head.cls_preds.1.weight: copying a param with shape torch.Size([80, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([7, 128, 1, 1]).
size mismatch for head.cls_preds.1.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([7]).
size mismatch for head.cls_preds.2.weight: copying a param with shape torch.Size([80, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([7, 128, 1, 1]).
size mismatch for head.cls_preds.2.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([7]).
官方代码,官方权重,只是运行tools/demo.py
这个到底是什么问题阿?