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

Error in Test the model with your pre-trained weights #7

Open
newZachary opened this issue Apr 8, 2021 · 1 comment
Open

Error in Test the model with your pre-trained weights #7

newZachary opened this issue Apr 8, 2021 · 1 comment

Comments

@newZachary
Copy link

Hi,
I have trained your pth, and tried to run evaluate.py.
But I got errors. The error message is: AttributeError: 'DataParallel' object has no attribute 'src_device_obj'.
I don't find the attribute 'src_device_obj'.

The complete error:
Extracting features... This may take a while...
Traceback (most recent call last):
File "Evaluate.py", line 94, in
final_feat_list, _, _, _, _, = model(Variable(imgs).cuda())
File "/home/stu/.conda/envs/pytorch2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/stu/.conda/envs/pytorch2/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 151, in forward
if t.device != self.src_device_obj:
File "/home/stu/.conda/envs/pytorch2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 948, in getattr
type(self).name, name))
AttributeError: 'DataParallel' object has no attribute 'src_device_obj'

I tried many times but couldn't solve it.
Counld you please help me? Thanks a lot!

@aryachiranjeev
Copy link

Hi @newZachary would you able to solve this error?

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

2 participants