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

Trainer class use fails with the error "No module named 'torchvision.models.utils'" #21

Closed
shubham166 opened this issue Nov 19, 2022 · 2 comments

Comments

@shubham166
Copy link

Trainer class use fails with the error "No module named 'torchvision.models.utils'"

Full stack here -
Traceback (most recent call last):
File "src/main/pipelines/train_nsfw_mtl.py", line 11, in
from LibMTL import Trainer
File "/azureml-envs/azureml_8a26314e09753d45d0790003a01faf79/lib/python3.8/site-packages/LibMTL/init.py", line 2, in
from . import model
File "/azureml-envs/azureml_8a26314e09753d45d0790003a01faf79/lib/python3.8/site-packages/LibMTL/model/init.py", line 1, in
from LibMTL.model.resnet import resnet18
File "/azureml-envs/azureml_8a26314e09753d45d0790003a01faf79/lib/python3.8/site-packages/LibMTL/model/resnet.py", line 3, in
from torchvision.models.utils import load_state_dict_from_url
ModuleNotFoundError: No module named 'torchvision.models.utils'

The issue is fixed by using 'torch.hub' instead.

@Baijiong-Lin
Copy link
Collaborator

I guess this problem is caused by the different versions of torchvision. We use version 0.9.0 here. We have clearly clarified the required packages with their corresponding version in LibMTL v1.1.6 which will be released formally soon.

@Baijiong-Lin
Copy link
Collaborator

Closed as no further updates.

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