总结在复现BEVFusion(mit)代码时训练、测试和可视化遇到的报错!
1、报错:ImportError: cannot import name ‘feature_decorator_ext’ from partially initialized module ‘mmdet3d.ops.feature_decorator’ (most likely due to a circular import) (/home/mengwen/bevfusion/mmdet3d/ops/feature_decorator/init.py)
解决:
(1)注释掉 mmdet3d/ops/init.py 中的 from .feature_decorator import feature_decorator
2、报错:FileNotFoundError: NuScenesDataset: [Errno 2] No such file or directory: ‘data/nuscenes//nuscenes_infos_train.pkl’
解决:更改tools/data_converter/nuscenes_converter.py 中第95~100行
info_path = osp.join(root_path,
'{}_infos_train.pkl'.format(info_prefix))
info_val_path = osp.join(root_path,
'{}_infos_val.pkl'.format(info_prefix))
3、报错:TypeError: FormatCode() got an unexpected keyword argument ‘verify’
解决:yapf包的版本问题,我原来yapf包的0.40.2,降低为yapf==0.40.1
pip install yapf==0.40.1
4、报错:AttributeError: module ‘distutils’ has no attribute ‘version’
解决:setuptools版本过高导致的问题
pip install setuptools==58.0.4
5、报错:RuntimeError: Given groups=1, weight of size [8, 1, 1, 1], expected input[24, 6, 256, 704] to have 1 channels, but got 6 channels instead
解决:将 mmdet3d/models/vtransforms/base 中第38行: add_depth_features=True 改为 False ,37行也改为 False
6、报错:RuntimeError: CUDA out of memory. Tried to allocate 168.00 MiB (GPU 0; 23.70 GiB total capacity; 2.41 GiB already allocated; 96.50 MiB free; 2.43 GiB reserved in total by PyTorch) If reserved memory i
解决:单卡gpu不能满足,采用分布式训练,在mmdet3d/apis/train.py文件中把distributed参数设置为True,直接vs-code全局搜索找到distributed
def train_model(
model,
dataset,
cfg,
distributed=True,
validate=False,
timestamp=None,
):
7、报错:ModuleNotFoundError: No module named ‘torchpack.utils.tqdm’
解决:把tools/visualize.py文件中from torchpack.utils.tqdm import tqdm改成from tqdm import tqdm