muelea / shapy

CVPR 2022 - Official code repository for the paper: Accurate 3D Body Shape Regression using Metric and Semantic Attributes.
https://shapy.is.tue.mpg.de/
305 stars 44 forks source link

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

Open ZhilinGuo opened 10 months ago

ZhilinGuo commented 10 months ago

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 commented 7 months ago

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.