BEVFusion(ICRA-2023)--01
说明:论文 BEVFusion: Multi-Task Multi-Sensor Fusion with Unified Bird’s-Eye View Representation 原代码运行记录
原始环境:python 3.9 + torch 1.12 (失败)
报错:
python setup.py develop/mmdet3d/ops/ball_query/src/ball_query.cpp:4:10: fatal error: THC/THC.h: 没有那个文件或目录4 | #include <THC/THC.h>| ^~~~~~~~~~~compilation terminated.ninja: build stopped: subcommand failed.Traceback (most recent call last):File "............................/anaconda3/envs/py39/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1808, in _run_ninja_buildsubprocess.run(File "............................/anaconda3/envs/py39/lib/python3.9/subprocess.py", line 528, in runraise CalledProcessError(retcode, process.args,subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1..........................RuntimeError: Error compiling objects for extension
寻找解决方案,应为版本不匹配问题,修改set.py
:
# cmdclass={"build_ext": BuildExtension},
# 修改为:
cmdclass={'build_ext': BuildExtension.with_options(use_ninja=False)}
错误:
mmdet3d/ops/ball_query/src/ball_query.cpp:4:10: fatal error: THC/THC.h: 没有那个文件或目录4 | #include <THC/THC.h>| ^~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
问题可能为torch版本过高。
方法1:
THC.h在pytorch 1.11版本中被移除了,需要修改代码。
将set.py中提到的cpp文件的所有关于THC.h的代码修改:
//#include <THC/THC.h>
#include <ATen/cuda/CUDAContext.h>
#include <ATen/cuda/CUDAEvent.h>
//extern THCState *state;
涉及的文件包括:
src/ball_query.cpp
src/knn.cpp
src/group_points.cpp
src/interpolate.cpp
src/furthest_point_sample.cpp
src/gather_points.cpp
方法2:(失败了,仅记录)
按requirement搭建新的环境。
记录:
# Python >= 3.8, <3.9
conda create -n py38 python=3.8
conda activate py38
# OpenMPI = 4.0.4 and mpi4py = 3.0.3 (Needed for torchpack)
conda install -c conda-forge openmpi=4.0.4
conda install -c conda-forge mpi4py=3.0.3
# Pillow = 8.4.0 (see here)
# conda install -c conda-forge pillow=8.4.0
conda install pillow=8.4.0
# PyTorch >= 1.9, <= 1.10.2
conda install pytorch==1.10.0 torchvision==0.11.0 torchaudio==0.10.0 cudatoolkit=11.7 -c pytorch -c conda-forge
# tqdm
conda install -c conda-forge tqdm
# torchpack
pip install torchpack
# mmcv = 1.4.0
conda install -c esri mmcv-full
# mmdetection = 2.20.0
pip install mmdet==2.20.0
# nuscenes-dev-kit
pip install nuscenes-devkit
报错:
writing manifest file 'mmdet3d.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):File "setup.py", line 42, in <module>setup(
.........................................match = self._regex.search(version)
TypeError: expected string or bytes-like object