girishnjha
girishnjha

Reputation: 81

Error in training opennmt - caffe2_detectron_ops.dll not found

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

Answers (6)

Marcos Aires
Marcos Aires

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

odunayo12
odunayo12

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

Ali Kh. Roudbari
Ali Kh. Roudbari

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

SpaceKees
SpaceKees

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.

enter image description here

Installing intel-openmp as suggested by user @sushmitha resolved the issue.

Upvotes: 0

youngwoon
youngwoon

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

sushmitha
sushmitha

Reputation: 11

Try this, pip install intel-openmp.

It worked for me

Upvotes: 0

Related Questions