Skip to content Skip to sidebar Skip to footer

Pytorch Could Not Find Module

I have installed pytorch with command: conda install pytorch torchvision cudatoolkit=10.2 -c pytorch -y Python complains regarding line import torch with message: Could not find m

Solution 1:

I faced the same problem. If your OS is Windows then I would recommend using Anaconda and installing pytorch in separate conda environment. Quick solution is to search for nvcuda.dll file on google and download this file. If you are running the code on Jupyter notebook the output will give you the complete path of the 'lib' folder of conda environment. By default it is 'C:\Users\YourUserName\anaconda3\envs\mera_beta\Lib\site-packages\torch\lib'. Go this directory and paste the file in this folder. Rerun your code. Hopefully it will run.

Solution 2:

Do you have a GPU on your machine? Try installing without CUDA and that fixed it for me.

Solution 3:

Post a Comment for "Pytorch Could Not Find Module"