Error in training opennmt - caffe2_detectron_ops.dll not found
Asked Answered
D

6

7

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

Dramamine answered 28/8, 2020 at 7:9 Comment(1)
peterjc123, i installed intel-opnmp too, but it made no differenceDramamine
C
11

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")

Confidential answered 4/1, 2021 at 16:6 Comment(1)
Genius! How did you figure this out. Thanks a lot :)Protestant
M
1

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.

Mclyman answered 14/9, 2021 at 1:34 Comment(0)
H
0

Try this, pip install intel-openmp.

It worked for me

Hulen answered 12/11, 2020 at 16:56 Comment(1)
Hi Sushmitha. The creator of this question has specifically stated that they have tried to install this package and it did not work.Than
S
0

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.

Senter answered 2/5, 2021 at 21:26 Comment(0)
W
0

delete caffe2_detectron_ops.dll file from C:\Users\ <your_user_name> \anaconda3\envs\ <your_environment> \Lib\site-packages\torch\lib

Wolpert answered 24/6, 2021 at 7:56 Comment(0)
S
0

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
Syck answered 22/1, 2022 at 9:17 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Schroer

© 2022 - 2024 — McMap. All rights reserved.