最终解决方法看最后
pycharm提示缺少mmcv 点击安装,失败,错误提示如下。
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- mmcv
Current channels:
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
.......
好像是说从那些源里没找到安装包
然后尝试pipi install mmcv,一片红。。
Building wheel for mmcv (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-gskkosif/mmcv/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gskkosif/mmcv/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-5g9ewta7
cwd: /tmp/pip-install-gskkosif/mmcv/
Complete output (325 lines):
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-10.1'
running bdist_wheel
.......
没看懂啥意思,但根据最后的解决方案 猜测是版本不匹配的问题(pytorch cuda 和mmcv)
然后通过源码安装
git clone https://github.com/open-mmlab/mmcv.git
cd mmcv
pip install -e .
报错好像和上面pip安装时差不多
最终解决:
github地址中的readme有详细的安装介绍(We provide pre-built mmcv packages (recommended) with different PyTorch and CUDA versions to simplify the building.)
根据版本选择了
pip install mmcv-full==latest+torch1.6.0+cu101 -f https://download.openmmlab.com/mmcv/dist/index.html
直接安装成功