Reproduce DeepInteraction

1. Installation environment

Here are some of the more important versions:

Graphics card: 4090&2080ti

CUDA=11.1

python=3.8

torch=1.9.0+cu111

torchvision=0.10.0+cu111

spconv-cu111=2.1.25

numpy=1.21.0

number=0.48.0

mmdet=2.25.0

mmdet3d=0.17.1

mmcv-full=1.3.18

The installation process basically follows MMDET3D, just pay attention to some installation package versions:

Ubuntu22.04 installs mmdet 2.25.1+ mmdet3d 1.0.0rc6_Holding Qianbaigai in the air, why not simply record the installation process of mmdet and mmdet3d on the blog-CSDN blog where you go to have tea. https://blog.csdn.net/weixin_44013732/article/details/130675061


2. Environment construction

 1. Configure mmdet3d environment

(1) Create a virtual environment (no need to install packages, Anconda automatically installs python):

conda create -n deepinteraction python=3.8

(2) Activate the environment

 conda activate deepinteraction 

 (3) Install torch and torchvision

Installation instructions: Local installation is recommended, otherwise pip will accidentally install the cpu version.

①Download file

Link: 

Baidu Cloud : Find the following folder, which contains the torch and torchvision installation packages .

②Installation

Use the pip command to implement local installation :

pip install torch-1.9.0+cu111-cp38-cp38-linux_x86_64.whl torchvision-0.10.0+cu111-cp38-cp38-linux_x86_64.whl

③Test

First enter python to enter the environment and enter the following commands:

import torch    # 如正常则静默
torch.__version__ #查看torch版本
import torchvision
torchvision.__version__ #查看torchvision版本
torch.cuda.is_available() #正常的话返回“True”
a = torch.Tensor([1.])    # 如正常则静默
a.cuda()    # 如正常则返回"tensor([ 1.], device='cuda:0')"
from torch.backends import cudnn # 如正常则静默
cudnn.is_acceptable(a.cuda())    # 如正常则返回 "True"

The display works normally:

  ④Official download website

If you don’t want to use Baidu Cloud, here is the official download website:

torch download website: https://download.pytorch.org/whl/torch_stable.html

 torch 1.9.0+cu111:https://download.pytorch.org/whl/cu111/torch-1.9.0%2Bcu111-cp38-cp38-linux_x86_64.whl

torchvision 0.10.0+cu111:https://download.pytorch.org/whl/cu111/torchvision-0.10.0%2Bcu111-cp38-cp38-linux_x86_64.whl 


 (4) Install mmcv-full 1.3.18

①pip installation

pip install mmcv-full==1.3.18 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html

 You cannot just use the pip install mmcv-full command to install it here. You need to add your own cuda information and torch information later.

 (5) Install mmsegmentation

Installation instructions: Only mmdet3d needs to be installed.

①pip installation

pip install mmsegmentation==0.14.1

②Local installation

Go to the /mmsegmentation-master folder and execute:

pip install -r requirements.txt

python setup.py develop

 (6) Install mmdet

Installation instructions: If you want to run mmdet instead of mmdet3d, it is recommended to install it locally to facilitate data running later.

①pip install mmdet

 pip install mmdet==2.14.0

②Install mmdet locally

 Go to the /mmdetection folder and execute:

pip install -r requirements.txt

python setup.py develop

 (7) Install mmdet3d

①Official installation instructions

git clone https://github.com/open-mmlab/mmdetection3d.git
cd mmdetection3d
git checkout v0.17.1
python setup.py install

②Local installation

Enter the /mmdetection3d-master folder

implement:

pip install -r requirements

python setup.py develop

(8) Install detectron2

The Dynamic Conv module in detectron2 is used. The instructions are as follows:

python -m pip install detectron2 -f \
  https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.9/index.html

2. Download and configure the data set

 Official website method:

Dataset Preparation — MMDetection3D 1.2.0 documentation icon-default.png?t=N7T8https://mmdetection3d.readthedocs.io/en/latest/user_guides/dataset_prepare.html By unzipping the dataset into a folder, and then executing the instructions:

python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes

The converted results are as follows:

 

3. Pre-training weights

Copy the pretrained weights to the pretrained/ folder:

 3. Train & Test

# train with 8 GPUs
tools/dist_train.sh projects/configs/nuscenes/Fusion_0075_refactor.py 8
# test with 8 GPUs
tools/dist_test.sh projects/configs/nuscenes/Fusion_0075_refactor.py ${CHECKPOINT_FILE} 8 --eval=bbox

Change the number of GPUs according to your needs.

4. Encountering problems

1、ModuleNotFoundError: No module named 'numba.errors'

 Solution: The numba version is too high and needs to be installed to 0.48.0:

pip install numba==0.48.0


2、RuntimeError: Address already in use xxx

Problem description: The port is occupied

solution:

In the file /home/xd/xyy/DeepInteraction-main/tools/dist_train.sh


You can specify the port number of the terminal command. Add --port 12345 after running the terminal command. The port number can be specified arbitrarily, and only five digits are enough.

Reference: Solution : Alchemist Training Program Pytorch+DeepLearning Various Error Reports and Traps and Pitfalls and Avoidance Records (4)_store = tcpstore(master_addr, master_port, world_s_a blog about a medium cup of Coke with ice - CSDN blog


 3、KeyError: 'SwinTransformer is already registered in models'

Solution: Just comment out from .swin_transformer import SwinTransformer in /DeepInteraction-main/projects/mmdet3d_plugin/__init__.py

 reference: 

FastBEV reproduces Ubuntu_A confused insect's blog-CSDN blog


  4、from numba.errors import NumbaPerformanceWarning 

Solution: Install numba==1.48 as required 


5、AttributeError: 'ConfigDict' object has no attribute 'device'

Solution:

meta['config'] = cfg.pretty_textAdd the following code below tools/train.py :

cfg.device='cuda'

 reference:

AttributeError: 'ConfigDict' object has no attribute 'device'_attributeerror: 'config' object has no attribute '_Tangchao Lier's Blog-CSDN Blog

6、 mmcv/_ext.cpython-38-x86_64-linux-gnu.so: undefined symbol: _Z27points_in_boxes_cpu_forwardN2at6TensorES0_S0_

Solution:

pip install mmcv-full==1.3.18 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html
 

You cannot just use the pip install mmcv-full command to install it here. You need to add your own cuda information and torch information later. 

Guess you like

Origin blog.csdn.net/weixin_44013732/article/details/132626064