Open xiaoweihappy123 opened 6 years ago
please use pytorch 0.3.1
if i don't want to change pytorch version ,can i have ways to solve it?
@lsy978745722 replace the samplers.py code 7: class RandomIdentitySampler(object): to 7: class RandomIdentitySampler(torch.utils.data.sampler.Sampler):
@lsy978745722 Or add from torch.utils.data import Sampler at the very top
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>