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

xrv.models.DenseNet(weights="all").cuda() problem in new update #26

Closed
dara1400 opened this issue Aug 6, 2020 · 8 comments
Closed

xrv.models.DenseNet(weights="all").cuda() problem in new update #26

dara1400 opened this issue Aug 6, 2020 · 8 comments

Comments

@dara1400
Copy link

dara1400 commented Aug 6, 2020

Hello
Thanks for great repo

It seems you recently updated your codes,
This error happens when i try to load pretrained net:

xrv.models.DenseNet(weights="all").cuda()

/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in getattr(self, name)
770 return modules[name]
771 raise ModuleAttributeError("'{}' object has no attribute '{}'".format(
--> 772 type(self).name, name))
773
774 def setattr(self, name: str, value: Union[Tensor, 'Module']) -> None:

ModuleAttributeError: 'BatchNorm2d' object has no attribute '_non_persistent_buffers_set'

@ieee8023
Copy link
Member

ieee8023 commented Aug 6, 2020

Ok I see it. It seems to be related to a new version of torchvision or torch. I tested it with torchvision 0.6.1 and it worked so you can downgrade to that. I'll look more into it today.

@dara1400
Copy link
Author

dara1400 commented Aug 6, 2020

I have downgraded as:
!pip install torchvision==0.6.1

now this error happened:

The NVIDIA driver on your system is too old (found version 10010).
Please update your GPU driver by downloading and installing a new
version from the URL: http://www.nvidia.com/Download/index.aspx
Alternatively, go to: https://pytorch.org to install
a PyTorch version that has been compiled with your version
of the CUDA driver.

Also I forgot to mention, I am using google colab

@ieee8023
Copy link
Member

ieee8023 commented Aug 6, 2020

I have a fix. I am pushing in in 5 min.

@ieee8023
Copy link
Member

ieee8023 commented Aug 6, 2020

It is the same issue and solution here: pytorch/pytorch#42242

@ieee8023
Copy link
Member

ieee8023 commented Aug 6, 2020

Ok the version 0.0.13 should fix it.

@dara1400
Copy link
Author

dara1400 commented Aug 6, 2020

Thanks a lot
It is working well.

@ieee8023 ieee8023 closed this as completed Aug 6, 2020
@Jen2351
Copy link

Jen2351 commented Mar 11, 2021

Hi there,

I have the same issue right now. I run this line in Spyder and then it shows the error "AttributeError: module 'torchxrayvision' has no attribute 'models'". The version of torchxrayvision is 0.0.24, torchvision is 0.9.0 and torch is 1.8.0. I have tried to downgrade the torchxrayvision to 0.0.23, but it did not help.

@ieee8023
Copy link
Member

@Jen2351 maybe you have a folder called torchxrayvision in your path that is confusing the import?

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

3 participants