mmmmm
mmmmm

Reputation: 21

PyTorch dll issues for Caffe2

I am using a Windows 10 Machine and after re-installing Anaconda and all of the packages I had previously, including torchvision, torch and necessary dependencies, I am still getting this error:

OSError: [WinError 127] The specified procedure could not be found. Error loading "C:\Users\XXX\Anaconda3\envs\XXX\lib\site-packages\torch\lib\caffe2.dll" or one of its dependencies.

I am using python 3.7.9 and:

I've looked into it quite a bit but feel like this should be an easy solve...

I do not have CUDA and have used this: conda install pytorch torchvision torchaudio cpuonly -c pytorch

as per instructed on the official website of pytorch

Upvotes: 2

Views: 8162

Answers (4)

João Bravo
João Bravo

Reputation: 267

To sum up all answers, using conda to install PyTorch tends to give the [WinError 127] error. Use pip to install PyTorch according to the instructions in the official website.

Upvotes: 0

nogmos
nogmos

Reputation: 909

I tried to install PyTorch with Anaconda and had the same error. For me what solved the issue was to uninstall Pytorch using Pip (even though I installed it with conda) and then installing again with Pip as explains at PyTorch guide.

Uninstall:

pip uninstall torch
pip uninstall torchvision
pip uninstall torchaudio

Install:

pip3 install torch torchvision torchaudio

Upvotes: 1

Jay
Jay

Reputation: 11

I had the same problem, so I uninstalled the pytorch in my machine using "conda uninstall pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch"

Then did a clean installation using the following "pip install torch===1.7.0 torchvision===0.8.1 torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html"

I did not use conda for installation as it was persistently giving me the cpu version of pytorch.

Upvotes: 0

Jacolack
Jacolack

Reputation: 1508

After a long time trying many things with Anaconda I decided to use bare python instead and I installed Python 3.8.6 and installed PyTorch from the link you provided and it finally worked even with CUDA support. Make sure to completely remove all Anaconda/Other Python version scripts from your path to ensure only the 3.8.6 version is used by your prompt.

Upvotes: 1

Related Questions