Search code examples
pythonpytorchtorchvision

I can't import torchvision


I installed torchvision0.12.0, python3.8 and my OS is Windows. I succeeded in importing torch, but I couldn't import torchvision and getting this error.

ImportError

DLL load failed while importing _imaging: File "C:\Users'MyName'\Documents\GitHub\pytorch-cifar\main.py", line 8, in import torchvision

Is there someone who can solve this problem?


Solution

  • This may be due to incompatible versions of torch and torchvision.You can get the information you want through the following link:

    the corresponding torchvision versions and supported Python versions