mmcv
mmcv copied to clipboard
An error occurred while compiling and installing mmcv-full 1.7.1, RuntimeError: Error compiling objects for extension
Prerequisite
- [X] I have searched Issues and Discussions but cannot get the expected help.
- [X] The bug has not been fixed in the latest version(https://github.com/open-mmlab/mmcv).
Environment
{'sys.platform': 'win32', 'Python': '3.8.16 (default, Jan 17 2023, 22:25:28) [MSC v.1916 64 bit (AMD64)]', 'CUDA available': True, 'GPU 0': 'NVIDIA GeForce GTX 1660 Ti', 'CUDA_HOME': 'D:\Python\CUDA\cuda Development', 'NVCC': 'Cuda compilation tools, release 11.1, V11.1.74', 'PyTorch': '1.9.0+cu111', 'TorchVision': '0.10.0', 'OpenCV': '4.7.0', 'MMCV': '1.7.1', 'MMCV Compiler': 'n/a', 'MMCV CUDA Compiler': 'n/a'}
Reproduces the problem - code sample
Follow the official installation mmcv-full documentation(https://mmcv.readthedocs.io/en/latest/get_started/build.html#common-steps). While using python setup.py build_ext.
Reproduces the problem - command or script
python setup.py build_ext
Reproduces the problem - error message
File "D:\Python\Anaconda\anaconda3\envs\mmlab\lib\site-packages\torch\utils\cpp_extension.py", line 1682, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error compiling objects for extension
Additional information
No response
Hi, the error message provided is not enough to find out the failure reason. BTW, you can install it with the pre-built packages by the following commands.
pip install -U openmim
mim install mmcv-full
Hi, the error message provided is not enough to find out the failure reason. BTW, you can install it with the pre-built packages by the following commands.
pip install -U openmim mim install mmcv-full
Thank you for your reply. I have tried the method you provided. I also tried using pip install mmcv-full==1.6.2 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9/index.html to install mmcv-full which fits my environment.
But while I follow the Official Tutorials to compile mmcv-full with using This command python setup.py build_ext in Anaconda powershell prompt.
It still raise error:
Traceback (most recent call last):
File "setup.py", line 520, in
Anyway, when I using python .dev_scripts/check_installation.py to validate installation, it work! Here is the output: TorchVision: 0.10.0 OpenCV: 4.7.0 MMCV: 1.6.2 MMCV Compiler: MSVC 192930137 MMCV CUDA Compiler: 11.1
However, this file _ext.cp38-win_amd64.pyd is not in the mmcv folder. I knew it had failed to compile.
I hope you can help me solve this problem!
Could you provide the output of pip show mmcv-full
?
Hi, the error message provided is not enough to find out the failure reason. BTW, you can install it with the pre-built packages by the following commands.
pip install -U openmim mim install mmcv-full
OH, MY, GOOOOOOOOOOOOOOD!!! how do you know this command?i mean, i have checked the mmcv doc and follow it, but still failed, but these two command...success!!Although i install both mmcv 2.0.0 and mmcv-full 1.7.1, a liitle wierd but anyway the code runs. YOU ARE SUCH A GENIUS!!