torchvision이 torch와 호환되지 않는 경우 발생하는 문제로 추측
1. torchvision 재설치 or torch version에 맞춰 torchvison 버전을 변경하거나
pip3 install torchvision==[$VERSION] -f https://download.pytorch.org/whl/torch_stable.html
ex) pip3 install torchvision==0.8.2+cu110 -f https://download.pytorch.org/whl/torch_stable.html
https://github.com/pytorch/pytorch/issues/42078
AttributeError: module 'torch.jit' has no attribute '_script_if_tracing' · Issue #42078 · pytorch/pytorch
🐛 Bug Error using the pytorch.hub API: code: import torch from torch import hub resnet18_model = hub.load('pytorch/vision:master','resnet18',pretrained=True) Error Downloading: &quo...
github.com
Unable to import torchvision --AttributeError: module 'torch.jit' has no attribute 'unused'. Windows10, Python 3.7
I am trying to import torchvision but I am getting an error. I researched the topic in the Web and there seems to be a problem with the later versions. Different solutions were offered --mostly
stackoverflow.com
torchvision 0.7 has been released and is compatible with torch 1.6. It does not appear to be compatible with torch 1.5.
Note that installing torchvision via PyCharm may not result in an automatic upgrade of torch. Installing via pip3 did automatically upgrade torch however.
pip install torch==1.6.0+cpu torchvision==0.7.0+cpu -f https://download.pytorch.org/whl/torch_stable.html