Solving WinError of Pytorch Error Loading caffe2_detectron_ops.dll
Introduction
When running new version of Pytorch with the CUDA 11.3 on Windows 10, I've encountered a strange error message: OSError: [WinError 127] The specified procedure could not be found. Error loading caffe2_detectron_ops.dll.
Environments
OS: Windows 10 Pro for WorkStation
Python: 3.8.11
Conda: 4.10.3
Pip: 21.0.1
Pytorch: 1.10.0
Pytorch Installation
I installed the Pytorch with the command provided on the official website of Pytorch, selecing stable (1.10) Pytorch build, Windows OS, Conda package, Python language, CUDA 11.3 compute platform.
Error Message
After successful installation of Pytorch, I ran a program which use Pytoch.
From the issue discussion on Github, I found out that by deleting caffe2_detectron_ops.dll the error will disappear.
Conclusion
In the same directory another file with similar name, caffe2_detectron_ops_gpu.dll, can be found, maybe it's because I installed a GPU version of Pytorch, caffe2_detectron_ops.dll shouldn't be loaded at all.