jiyanggao / Video-Person-ReID

Video-based Person ReID Method Implementations on MARS
381 stars 110 forks source link

To run an error #2

Open xiaoweihappy123 opened 6 years ago

xiaoweihappy123 commented 6 years ago

When I run this code:python main_video_person_reid.py --arch=resnet50tp Compared with the deep-person-reid project, I did not find the reason for error reporting. Can you give me some suggestions. Traceback (most recent call last): File "main_video_person_reid.py", line 294, in main() File "main_video_person_reid.py", line 122, in main pin_memory=pin_memory, drop_last=True, File "/home/xiaowei/anaconda2/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 437, in init batch_sampler = BatchSampler(sampler, batch_size, drop_last) File "/home/xiaowei/anaconda2/lib/python2.7/site-packages/torch/utils/data/sampler.py", line 124, in init .format(sampler)) ValueError: sampler should be an instance of torch.utils.data.Sampler, but got sampler=<samplers.RandomIdentitySampler object at 0x7f87c3608b50>

jiyanggao commented 6 years ago

please use pytorch 0.3.1

lsy978745722 commented 6 years ago

if i don't want to change pytorch version ,can i have ways to solve it?

xxjjvxb commented 6 years ago

@lsy978745722 replace the samplers.py code 7: class RandomIdentitySampler(object): to 7: class RandomIdentitySampler(torch.utils.data.sampler.Sampler):

kerryliu28 commented 5 years ago

@lsy978745722 Or add from torch.utils.data import Sampler at the very top