Zhongdao / Towards-Realtime-MOT

Joint Detection and Embedding for fast multi-object tracking
MIT License
2.38k stars 539 forks source link

AttributeError: 'LoadImages' object has no attribute 'files' #223

Open fanshu4869 opened 3 years ago

fanshu4869 commented 3 years ago

Hello, @Zhongdao first of all, thanks for sharing your work here with us. I was trying to run track.py as you mentioned in the readme file, and I downloaded the dataset you provided MOT16 but I have this weird error, I'm not sure what is the problem! I try to run the following: python track.py --cfg cfg/yolov3_1088x608.cfg --weights weights/jde.1088x608.uncertainty.pt

and I get this error msg: 2020-06-27 00:21:22 [INFO]: start seq: MOT17-02-SDP Traceback (most recent call last): File "track.py", line 215, in save_videos=opt.save_videos) File "track.py", line 135, in main dataloader = datasets.LoadImages(osp.join(data_root, seq, 'img1'), opt.img_size) File "/home/zc/MOT/jde/utils/datasets.py", line 26, in init self.nF = len(self.files) # number of image files AttributeError: 'LoadImages' object has no attribute 'files' 2021-04-03 21-18-10屏幕截图

When I add --test-mot16 to the command line,the results are correct

afonseca18 commented 3 years ago

Any updates on this issue? Thanks in advance.

geyu1998 commented 3 years ago

you can check whether the path osp.join(data_root,seq,'img1') is true

dierye commented 2 years ago

it's a wrong path in the original code: track.py--data_root = os.path.join(opt.data_dir, 'MOT16/train') you can check this,and add 'images/' MT(B82Q``NQLL`)}OHUU1X0

JackWoo0831 commented 2 years ago

Hello. I've already solved this problem just now. If you're testing it on MOT16, The reason is that you should fix the path in track.py:

Firstly, in line 206, the 'data_root' should be assigned to your own MOT16 dataset test path, e.g.: data_root = 'E:/Practice_code/python_code/MOTlearning/deep_sort-master/MOT16/test'

Secondly, in line 116, the parameter 'data_root' should be assigned to your own MOT16 dataset train path: def main(opt, data_root='E:/Practice_code/python_code/MOTlearning/deep_sort-master/MOT16/train', det_root=None, seqs=('MOT16-05',), exp_name='demo',

Finally, when you run it in terminal, please remember to active the argument '--test-mot16', because it is setted as: parser.add_argument('--test-mot16', action='store_true', help='tracking buffer') so only when it is actived, the program will test on MOT16.

so the command should be like: python track.py --cfg ./cfg/yolov3_1088x608.cfg --weights weights/jde.1088x608.uncertainty.pt --test-mot16