DeepLabV3Plus-Pytorch icon indicating copy to clipboard operation
DeepLabV3Plus-Pytorch copied to clipboard

main.py gets an error 'ModuleNotFoundError: No module named 'torchvision.models.utils'

Open thatsdone opened this issue 4 years ago • 1 comments

main.py fails saying 'ModuleNotFoundError: No module named 'torchvision.models.utils' like below.

Looks like there were torchvision structure changes, and 'pip install torchvision=0.4.1' resolves this issue at least.

# python main.py --help
Traceback (most recent call last):
  File "main.py", line 2, in <module>
    import network
  File "/work/DeepLabV3Plus-Pytorch/network/__init__.py", line 1, in <module>
    from .modeling import *
  File "/work/DeepLabV3Plus-Pytorch/network/modeling.py", line 3, in <module>
    from .backbone import resnet
  File "/work/DeepLabV3Plus-Pytorch/network/backbone/__init__.py", line 1, in <m
odule>
    from . import resnet
  File "/work/DeepLabV3Plus-Pytorch/network/backbone/resnet.py", line 3, in <mod
ule>
    from torchvision.models.utils import load_state_dict_from_url
ModuleNotFoundError: No module named 'torchvision.models.utils'
root@b5a88c742403:/work/DeepLabV3Plus-Pytorch# pip list | grep torchvision
torchvision             0.11.1
#

thatsdone avatar Nov 02 '21 00:11 thatsdone

Thanks! This error was fixed in the latest commit.

VainF avatar Nov 02 '21 06:11 VainF