MMdetection3D更新了,只好再次安裝,由于CUDA,cuDNN,PyTorch以前已經安裝了,這次就不需要安裝了,只需要安裝MMdetection3D就行了.
1. 安裝MMCV
輸入以下命令:
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
如我的CUDA版本是11.2,PyTorch是1.11.0:
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu112/torch1.11.0/index.html
2. 安裝MMDetection
依次輸入以下命令:
git clone https://github.com/open-mmlab/mmdetection.git cd mmdetection pip install -r requirements/build.txt pip install -v -e . # or "python setup.py develop"
如果github.com速度慢,也可以換成gitee.com.
3. 安裝MMDetection3D
依次輸入以下命令:
git clone https://github.com/open-mmlab/mmdetection3d.git
cd mmdetection3d
pip install -v -e .
同樣的,如果github.com速度慢,也可以換成gitee.com.
4. 安裝MinkowskiEngine
由于最新版的MMDetection3D用到了MinkowskiEngine,還需要安裝MinkowskiEngine.
首先下載(這個gitee.com好像沒有):
git clone https://github.com/NVIDIA/MinkowskiEngine.git
cd MinkowskiEngine
將setup.py第142行
MAX_COMPILATION_THREADS = 12
改成
MAX_COMPILATION_THREADS = 4
然后更換gcc/g++的版本,依次輸入以下命令:
sudo apt install gcc-7 sudo apt install g++-7 rm /usr/bin/gcc ln -s /usr/bin/gcc-7 /usr/bin/gcc rm /usr/bin/g++ ln -s /usr/bin/g++-7 /usr/bin/g++ gcc --version g++ --version
如果gcc/g++的版本都是7.5.0就可以了.
再安裝安裝MinkowskiEngine:
python setup.py install --blas_include_dirs=${CONDA_PREFIX}/include --blas=openblas
其中${CONDA_PREFIX}是Conda環境名稱,如我的Conda環境是hzmd:
python setup.py install --blas_include_dirs=hzmd/include --blas=openblas
這里又出現了一個錯誤:
fatal error: cblas.h: No such file or directory
輸入:
sudo apt-get install libopenblas-dev
錯誤解決,再次輸入MinkowskiEngine安裝命令,耐心等待了一段時間,安裝成功,MMDetection3D也可以運行了!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/501838.html
標籤:其他
