Skip to content

ImportError: DLL load failed while importing _ext: The specified procedure could not be found. #1594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gitgitgithut opened this issue Dec 17, 2021 · 17 comments

Comments

@gitgitgithut
Copy link

Hi there, I recently installed mmcv-full 1.4.1 and mmdet 2.19.1 using conda and openmim on my windows 10 device, and encountered an import error when running the following line:
from mmdet.apis import init_detector, inference_detector, show_result_pyplot
The error messages I got were:

image

I double checked the versions of my cudatoolkit, torch, mmcv-full and mmdet, and everything seems fine to me. I have pytorch==1.10.0, cudatoolkit==11.3.1, mmcv-full==1.4.1 and mmdet==2.19.1.

I tried to reinstall mmcv-full to check I got the build version correctly, here's the result:
image

Yet the same error messages were printed. I suspect it is still an compatibility issue between mmcv-full and mmdet, but i think I got the installation steps correct. Would you please help me with this issue? Thank you.

The following are all the packages I have installed in my venv:
image
image
image
image

@zhouzaida
Copy link
Collaborator

Hi, did you install mmcv (not mmcv-full) before?

Note: Do not install both versions in the same environment, otherwise you may encounter errors like ModuleNotFound.

@gitgitgithut
Copy link
Author

Hi, did you install mmcv (not mmcv-full) before?

Note: Do not install both versions in the same environment, otherwise you may encounter errors like ModuleNotFound.

No, I have re-created my venv and I am certain that only mmcv-full is installed.

@del-zhenwu
Copy link
Collaborator

Hi, did you install mmcv (not mmcv-full) before?
Note: Do not install both versions in the same environment, otherwise you may encounter errors like ModuleNotFound.

No, I have re-created my venv and I am certain that only mmcv-full is installed.

I have uploaded the zip file for mmdet2.19.1-mmcv1.4.1-torch1.10.0-py38,would you give a try with installing the whl file?
mmdet-2.19.1-py3-none-any.whl.zip

@del-zhenwu
Copy link
Collaborator

@gitgitgithut This package has been proved OK in my env.
image

@gitgitgithut
Copy link
Author

@gitgitgithut This package has been proved OK in my env. image

Hi there, I re-installed my venv using the .whl file you provided me, and the problem persists.
Here are my installation steps:

  1. create a new conda venv with python==3.8.12
  2. use pip to install mmdet from the wheel you provided me:
    pip install mmdet-2.19.1-py3-none-any.whl
  3. use conda to install pytorch and cudatoolkits with:
    conda install pytorch==1.10.0 torchvision torchaudio cudatoolkit=11.3 -c pytorch
  4. use pip to install opencv-python-headless and openmim with:
    pip install opencv-python-headless openmim
  5. use openmim to install mmcv-full:
    mim install mmcv-full

Here's the output of running the same code:
image

The following is the installed packages' info:
image
image

@gitgitgithut
Copy link
Author

I just found out there are also some issues with mmcv:
image

@zhouzaida
Copy link
Collaborator

Hi @gitgitgithut , we have updated the pre-built packages of 1.4.1. Please have a try.

@gitgitgithut
Copy link
Author

Hi @zhouzaida @del-zhenwu, I have reinstalled my venv with the updated mmcv-full 1.4.2, the issue is now resolved:
image
Really appreciate your efforts, Thank you!

@YellowMatthew
Copy link

That helps much!!

@duduzai2019
Copy link

I have reinstalled my venv with the updated mmcv-full 1.4.2, the issue is now resolved

Hi @zhouzaida @del-zhenwu, I have reinstalled my venv with the updated mmcv-full 1.4.2, the issue is now resolved: image Really appreciate your efforts, Thank you!

hi, How can installI mmcv-full 1.4.2 ??
Thanks!

@gitgitgithut
Copy link
Author

Hi @duduzai2019, as the official mmcv documentation stated, you can use pip to install a specific version of mmcv-full with pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html.
image

@duduzai2019
Copy link

嗨,@duduzai2019,正如官方mmcv文档所述,您可以使用pip安装特定版本的mmcv-full。pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html 图像

Thank you for your answer, It has been replaced by mvcc 1.4.2 , but train.py is still an old proble
image
image

@aldazhu
Copy link

aldazhu commented Jul 7, 2023

hi

Encountered the same error in mmcv 2.0.0rc4 when attempting to install it using "pip install mmcv". However, I was able to resolve the issue by building mmcv from the source code。
gpu : Quadro M4000
cuda: 11.6
CUDA Capability: 5.2
windows10
The usage of 'build' can be referred to in this link:https://mmcv.readthedocs.io/en/latest/get_started/build.html

@lsewcx
Copy link

lsewcx commented Apr 16, 2024

已解决
原因可能使用pip安装
解决方法改用mim安装就成功了

@cybbbbbbb
Copy link

hi @gitgitgithut. I have the same problem as you, and it has been bothering me for three days. But I finally solved it now.

@vigneshwar1565
Copy link

Hi @cybbbbbbb , I'm facing the same issue.
I have installed mmcv - 2.0.0
when I do python demo/demo_skeleton.py demo.mp4 short_serve_out.mp4 --config slowonly_r50_8xb16-u48-240e_ntu60-xsub-keypoint,py --checkpoint slowonly_r50_8xb16-u48-240e_ntu60-xsub-keypoint_20220815-38db104b.pth --label-map tools/data/skeleton/label_map_ntu60.txt
Im getting ImportError: DLL load failed while importing _ext: The specified procedure could not be found.

@vigneshwar1565
Copy link

Hi @cybbbbbbb , I'm facing the same issue. I have installed mmcv - 2.0.0 when I do python demo/demo_skeleton.py demo.mp4 short_serve_out.mp4 --config slowonly_r50_8xb16-u48-240e_ntu60-xsub-keypoint,py --checkpoint slowonly_r50_8xb16-u48-240e_ntu60-xsub-keypoint_20220815-38db104b.pth --label-map tools/data/skeleton/label_map_ntu60.txt Im getting ImportError: DLL load failed while importing _ext: The specified procedure could not be found.

I was able to fix it by downgrading my pytorch to 2.0.0
pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants