Tochvision error: userwarning: failed to load image Python extension: could not find module
One reason is that the version of torchvision is too high. It is suspected that the new version of torchvision has its own pot. At first, according to the official website
pip3 install torch==1.10.1+cu102 torchvision==0.11.2+cu102 torchaudio===0.10.1+cu102 -f https://download.pytorch.org/whl/cu102/torch_stable.html
After that, the error of image will be reported. You only need to reduce the version of torch vision. For example, you can enter it in your Anaconda prompt
conda activate ltorch # ltorch is the name of the virtual environment I created
pip install torchvision==0.10.1+cu102 -f https://download.pytorch.org/whl/cu102/torch_stable.html
It was 0.11.2, but I reduced it to 0.10.1. Import without error:
Of course, you can change the version according to the following link
https://download.pytorch.org/whl/cu102/torch_stable.html
Read More:
- Importerror: DLL load failed: unable to find the specified module in Python
- Jupyter notebook Failed to Switch to the Virual Environment: DLL load failed python.exe could not find the entry
- How to Solve Python Importerror: DLL load failed: unable to find the specified program using tensorflow
- [Solved] Numpy Load Error: DLL load failed while importing _multiarray_umath: Could not be found Module
- [Solved] DLL load failed while importing _sqlite3: the specified module could not be found.
- Pycharm error: original error was: DLL load failed while importing _multiarray _Umath: the specified module could not be found
- [Mac Pro M1] Python3.9 import cv2 Error: Reason: image not found
- ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.
- [Solved] apex Xavier install torchvision error: illegal instruction
- [Solved] UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring it
- RuntimeError: Failed to register operator torchvision::_new_empty_tensor_op. +torch&torchversion Version Matching
- [Solved] supervisor Error: /usr/local/lib/python2.7/dist-packages/pkg_resources/py2_warn.py:22: UserWarning: Setuptools will stop working on Python 2
- [Solved] wxauto error: ImportError: DLL load failed while importing win32gui: Can’t find the specified program
- The solution of no such file or directory and cannot load native module running error of python3 pyinstaller after packaging
- [Solved] Python Image Library fails with message “decoder JPEG not available” – PIL
- FileNotFoundError: Could not find module ‘D:\Anaconda3\envs\labe\Library\bin\geos_c.dll‘ [Solved]
- [Solved] Vite build & Flask Error: Failed to load module script. Strict MIME type checking is enforced
- RTX 3090 Run pytorch Error: CUDA error: no kernel image is available for execution on the device
- [Solved] AttributeError: module ‘PIL.Image‘ has no attribute ‘open‘
- Not find or load Qt Platform plugin “windows“ [How to Solve]