注:结合了很多的博客
使用清华园
单个安装:
pip install pytest -i https://pypi.tuna.tsinghua.edu.cn/simple
全部安装:
升级 pip 到最新的版本
pip install pip -U
python -m pip install --upgrade pip
修改pip源为清华源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
亲测好用:anaconda切换到清华源
1.1 清华源中anaconda官方库的镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
1.2 清华源中anaconda第三方库conda forge的镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
1.3 清华源中pytorch的anaconda第三方镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
检查python版本
自带的是3.10,没有成功过。切换3.8建立conda环境
检查有没有python 3.8,没有的话安装3.8
查看版本:
conda lsit
安装:
conda install python=3.8
激活conda环境,安装mmdet3d
mmdet3d各种版本环环相扣,新的版本基本没有成功过,采用老版本可以成功
激活环境:mmdet3d可以换成自己的名字
conda create -n mmdet3d python=3.8 -y
conda activate mmdet3d
安装pytorch
pip install torch == 1.9.1+cu111 torchvision == 0.10.1+cu111 torchaudio == 0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
官方推荐mmcv,还是full靠谱些:
pip install mmcv-full == 1.4.0
安装mmdet和mmseg:
pip install mmdet == 2.14.0
pip install mmsegmentation==0.14.1
从源码安装mmdet3d:
git clone https://github.com/open-mmlab/mmdetection3d.git
cd mmdetection3d
git checkout v0.17.1 #0.17.X版本用比较多,推荐
pip install -v -e .
这种0.17.1 安装的版本比较老,官方推荐的
mim download mmdet3d --config pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car --dest .
不能用
有两个工具注意版本
numba == 0.48.0
numpy == 1.19.5
安装过程错误及解决:
推出环境:后面不用跟环境名字
conda deactivate
查看:
conda env list
1.undefined symbol: iJIT_NotifyEvent
这个符号在 MKL 2024.1 中被移除了,然而 PyTorch 是根据旧版本的 MKL 构建的。
解决:
conda install mkl==2024.0
2.fatal error: THC/THC.h: No such file or directory
1.11版本后,Pytorch中的THC/THC 命名空间已失效,apex 也已将其删除,但是其中的函数已移至 ATen 命名空间。
解决:
有博主推荐注释 THC/THC.h,可以原则直接降低版本重装
3.pip安装报错“TimeoutError: The read operation timed out”
切换清华源即可
4.ImportError: libGL.so.1: cannot open shared object file: No such file or directory
安装opencv:
apt install libgl1-mesa-glx
5.ERROR: Cannot uninstall numpy 1.24.2, RECORD file not found.
可以切换numpy版本,但是之后会报各种依赖错误,需要重新pip install pillow pyquaternion shapely decorator scipy sklearn scikit-learn tqdm等各个包,建议重新激活环境安装
6.因为mmdet3d版本依赖特别严重,建议按BEVformer等成熟版本使用