当前位置:   article > 正文

BEVFusion(MIT)环境配置 No such file or directory: ‘data/nuscenes/nuscenes_infos_train.pkl‘_no such file or directory: './data/nuscenes/nuscen

no such file or directory: './data/nuscenes/nuscenes_infos_train.pkl

环境命令参照

【代码工程】BEVFusion(MIT)环境部署

1. 针对我自己遇到的问题做了一点修改,pytorch版本过高(一开始我用的是2.1)可能会导致编译的时候出现某些头文件找不到,也可能是因为torch和cuda版本不匹配。

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,编译通过
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23

2. 数据准备(create_data.py)报错

想在mini数据集上测试

但是运行

python tools/create_data.py nuscenes --root-path ./data/nuscenes --version v1.0-mini --out-dir ./data/nuscenes --extra-tag nuscenes
  • 1

报错:

FileNotFoundError: NuScenesDataset: [Errno 2] No such file or directory: 'data/nuscenes/nuscenes_infos_train.pkl'
  • 1

在网上找了一些博客,去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)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

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)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19

修改:

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)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23

3.TypeError: FormatCode() got an unexpected keyword argument ‘verify‘

原因: yapf版本过高

解决方法:重装低版本yapf

pip install yapf==0.40.1

4. AttributeError: module ‘distutils’ has no attribute ‘version’

解决方法:重装低版本setuptools

pip install setuptools==59.5.0

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号