2

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:

  • torchaudio=0.6.0=py37
  • torchvision=0.7.0=py37_cpu
  • tornado=6.0.4=py37he774522_1
  • traitlets=5.0.5=py_0

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

Wazaki
  • 899
  • 1
  • 8
  • 22
mmmmm
  • 21
  • 1
  • 2
  • Getting the exact same error. I've tried everything and there's nothing about this anywhere. If you are/were able to find a solution please answer your own post! – Jacolack Nov 10 '20 at 06:07

4 Answers4

1

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.

Jacolack
  • 1,365
  • 2
  • 11
  • 25
1

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
nogmos
  • 859
  • 1
  • 8
  • 12
0

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.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Jay
  • 1
0

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.

João Bravo
  • 206
  • 4
  • 16