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

ImportError: cannot import name 'model_urls' from 'torchvision.models.resnet' #31

Open
ZhilinGuo opened this issue Nov 21, 2023 · 1 comment

Comments

@ZhilinGuo
Copy link

I have successfully installed everything in Installation instructions. However, I'm getting this error when running the demo code.

ImportError: cannot import name 'model_urls' from 'torchvision.models.resnet' (/home/user/.conda/envs/shapy/lib/python3.8/site-packages/torchvision/models/resnet.py)

I understand that the original repo was tested with Python 3.8, CUDA 10.2 and PyTorch 1.7.1. But due to a constraint of my GPU I can only use CUDA 11.X +. Thus I'm current using CUDA 11.8 and PyTorch 2.1.1.

Am I out of luck trying to run this code on my setup?

@muelea
Copy link
Owner

muelea commented Feb 17, 2024

Since PyTorch 2.1.1. does not support these functions you need to write them yourself or find the corresponding functions in PyTorch 2.1.1 and change the import accordingly.

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