mmcv安装

最终解决方法看最后

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

直接安装成功

  • 4
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 9
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值