Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To run an error #2

Open
xiaoweihappy123 opened this issue Jun 27, 2018 · 4 comments
Open

To run an error #2

xiaoweihappy123 opened this issue Jun 27, 2018 · 4 comments

Comments

@xiaoweihappy123
Copy link

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
Copy link
Owner

please use pytorch 0.3.1

@lsy978745722
Copy link

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

@xxjjvxb
Copy link

xxjjvxb commented Oct 24, 2018

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

@kerryliu28
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants