3090 + Ubuntu 18.04 配置 MMDetection 环境

date
May 19, 2021
slug
3090-ubuntu-1804-mmdetection-environment
status
Published
summary
Cells interlinked within cells interlinked.
type
Post
tags
DeepLearning
Linux
Notes
PyTorch
总结来说,我根本就不应该装 Ubuntu 18.04 搭配 3090。
但是现在装都装好了,那也没办法了。前两天环境出问题我重装了一次,记录一下步骤(显卡相关是 CUDA 11.0 + cudnn 8.0.5 + nvidia-smi 460,这部分没坏,就不写了)。
conda create --name open-mmlab python==3.7 conda activate open-mmlab pip3 install torch==1.7.1+cu110 -f https://download.pytorch.org/whl/torch_stable.html pip3 install mmcv-full==1.3.1 -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.0/index.html pip3 install mmdet==2.11.0
排雷:
  • 最重要的就是所有软件包版本相互匹配!匹配顺序是:显卡型号+系统→CUDA & cudnn→PyTorch→mmcv→mmdet
  • 现在装的是 CUDA 11.0→PyTorch 1.7.1→mmcv 1.3.1→mmdet 2.11.0,不出意外以后都用这个匹配链即可。
  • 如果报错说某个包没装一般是小问题,如果报错形如 ImportError: /home/sjtu/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/_ext.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN2at5emptyEN3c108ArrayRefIlEERKNS0_13TensorOptionsENS0_8optionalINS0_12MemoryFormatEEE,说明从mmcv开始向上的匹配链里面有地方不对,一般是 CUDA 和 PyTorch。
  • 匹配链。Cells interlinked within cells interlinked. With in one stem, a dreadfully distinct...
  • 有问题直接搜对应包的 Github Issues,绝对最快找到答案。Github Issues Debug 法真的无敌。相信我。
 
If you have any questions, please contact me.