赞
踩
conda create -n bevfusion python=3.8 -y // conda activate bevfusion 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 // 首先安装pytorch,服务器CUDA为11.2,因此向下兼容选择11.1的1.9.1的版本 pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9/index.html pip install mmdet==2.20.0 pip install Pillow==8.4.0 pip install tqdm pip install torchpack pip install nuscenes-devkit # pip install mpi4py //这里我在用安装的时候遇到了一些问题,导致后面测试的时候报错没有mpi4py模块,参照这里(https://github.com/mit-han-lab/bevfusion/issues/400),使用了conda install mpi4py -y pip install ninja pip install numba vim ~/.bashrc 在安装openmpi之前,需要修改环境变量,在末尾添加OMPI_MCA_opal_cuda_support=true conda install openmpi -y // 使用conda安装openmpi conda install mpi4py -y 在执行setup之前,需要在setup第25行添加本机显卡对应的算力设置,否则CUDA算力在编译的时候没有匹配 。3090对应算力为86,自行查询一下。 添加"-gencode=arch=compute_86,code=sm_86", pip install setuptools==59.5.0 //版本过高可能后面编译完了运行会报错 python setup.py develop // 最后安装mmdet3d,编译通过
想在mini数据集上测试
但是运行
python tools/create_data.py nuscenes --root-path ./data/nuscenes --version v1.0-mini --out-dir ./data/nuscenes --extra-tag nuscenes
报错:
FileNotFoundError: NuScenesDataset: [Errno 2] No such file or directory: 'data/nuscenes/nuscenes_infos_train.pkl'
在网上找了一些博客,去github上翻了一些issue,未能解决。后来发现在mmdetection3d官方代码库中
/tools/data_converter/nuscenes_converter.py 84行起
metadata = dict(version=version) if test: print('test sample: {}'.format(len(train_nusc_infos))) data = dict(infos=train_nusc_infos, metadata=metadata) info_path = osp.join(root_path, '{}_infos_test.pkl'.format(info_prefix)) mmcv.dump(data, info_path) else: print('train sample: {}, val sample: {}'.format( len(train_nusc_infos), len(val_nusc_infos))) data = dict(infos=train_nusc_infos, metadata=metadata) info_path = osp.join(root_path, '{}_infos_train.pkl'.format(info_prefix)) mmcv.dump(data, info_path) data['infos'] = val_nusc_infos info_val_path = osp.join(root_path, '{}_infos_val.pkl'.format(info_prefix)) mmcv.dump(data, info_val_path)
bevfusion从git上下载的源码
metadata = dict(version=version) if test: print('test sample: {}'.format(len(train_nusc_infos))) data = dict(infos=train_nusc_infos, metadata=metadata) info_path = osp.join(root_path, '{}_infos_test_radar.pkl'.format(info_prefix)) mmcv.dump(data, info_path) else: print(info_prefix) print('train sample: {}, val sample: {}'.format( len(train_nusc_infos), len(val_nusc_infos))) data = dict(infos=train_nusc_infos, metadata=metadata) info_path = osp.join(info_prefix, '{}_infos_train_radar.pkl'.format(info_prefix)) mmcv.dump(data, info_path) data['infos'] = val_nusc_infos info_val_path = osp.join(info_prefix, '{}_infos_val_radar.pkl'.format(info_prefix)) mmcv.dump(data, info_val_path)
修改:
metadata = dict(version=version) if test: print('test sample: {}'.format(len(train_nusc_infos))) data = dict(infos=train_nusc_infos, metadata=metadata) info_path = osp.join(root_path, '{}_infos_test_radar.pkl'.format(info_prefix)) //这里自行修改 mmcv.dump(data, info_path) else: print(info_prefix) print('train sample: {}, val sample: {}'.format( len(train_nusc_infos), len(val_nusc_infos))) data = dict(infos=train_nusc_infos, metadata=metadata) # info_path = osp.join(info_prefix, # '{}_infos_train_radar.pkl'.format(info_prefix)) info_path = osp.join(root_path, '{}_infos_train.pkl'.format(info_prefix)) mmcv.dump(data, info_path) data['infos'] = val_nusc_infos # info_val_path = osp.join(info_prefix, # '{}_infos_val_radar.pkl'.format(info_prefix)) info_val_path = osp.join(root_path, '{}_infos_val.pkl'.format(info_prefix)) mmcv.dump(data, info_val_path)
原因: yapf版本过高
解决方法:重装低版本yapf
pip install yapf==0.40.1
解决方法:重装低版本setuptools
pip install setuptools==59.5.0
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。