Reputation: 81
I have torch 1.6 and python 3.8. When training OpenNMT, it throws the following error -
OSError: [WinError 126] The specified module could not be found. Error loading "C:\Users\Girish\AppData\Local\Programs\Python\Python38\lib\sitepackages\torch\lib\caffe2_detectron_ops.dll" or one of its dependencies.
I checked the folder, the file is present there. I have tried uninstalling torch and reinstalling it, but no help.
Any help will be appreciated. thanks
Upvotes: 7
Views: 12211
Reputation: 1
Same error to me, but I think that deleting the items just disable the use of GPU use, this is not what I want. I've tried, the error is gone, but the use os GPU too...
import torch
torch.cuda.is_available()
The return is False.
Reinstall torch works to me:
# pip3 install torch==1.10.1+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html --user
# pip3 install torchaudio===0.10.1+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html --user
# pip3 install torchvision==0.11.2+cu113 torchaudio===0.10.1+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html --user
Upvotes: 0
Reputation: 585
In my case, after deleting caffe2_detectron_ops.dll
, it generated the same error for caffe2_detectron_ops_gpu.dll
, caffe2_module_test_dynamic.dll
, caffe2_observers.dll
and cublas64_11.dll
.
So I followed @youngwoon's step, I deleted them all. And everything works fine now.
Honestly, this has a root cause and should be explained. But unfortunately, I can't.
Upvotes: 1
Reputation: 1
delete caffe2_detectron_ops.dll file from C:\Users\ <your_user_name> \anaconda3\envs\ <your_environment> \Lib\site-packages\torch\lib
Upvotes: 0
Reputation: 31
You can find missing dependencies with various tools like Dependencies which is a rewrite of old Dependency Walker.
In my case the tool pointed to missing library libiomp5md.dll.
Installing intel-openmp as suggested by user @sushmitha resolved the issue.
Upvotes: 0
Reputation: 363
https://github.com/pytorch/pytorch/issues/35803#issuecomment-725285085
This answer worked for me.
Just deleting "caffe2_detectron_ops.dll" from the path ("C:\Users\Girish\AppData\Local\Programs\Python\Python38\lib\sitepackages\torch\lib\caffe2_detectron_ops.dll")
Upvotes: 11