UniAD icon indicating copy to clipboard operation
UniAD copied to clipboard

AttributeError: 'str' object has no attribute 'name'

Open sdc-sdd opened this issue 1 year ago • 2 comments

Traceback (most recent call last): File "/public/home/znwlzx_test/.conda/envs/cjx/lib/python3.8/site-packages/mmcv/utils/registry.py", line 52, in build_from_cfg return obj_cls(**args)return obj_cls(**args)

File "/public/home/znwlzx_test/data/cjx/UniAD/projects/mmdet3d_plugin/datasets/nuscenes_e2e_dataset.py", line 78, in init File "/public/home/znwlzx_test/data/cjx/UniAD/projects/mmdet3d_plugin/datasets/nuscenes_e2e_dataset.py", line 78, in init super().init(*args, **kwargs)super().init(*args, **kwargs)

File "/public/home/znwlzx_test/data/cjx/mmdetection3d/mmdet3d/datasets/nuscenes_dataset.py", line 129, in init File "/public/home/znwlzx_test/data/cjx/mmdetection3d/mmdet3d/datasets/nuscenes_dataset.py", line 129, in init super().init( File "/public/home/znwlzx_test/data/cjx/mmdetection3d/mmdet3d/datasets/custom_3d.py", line 64, in init super().init( File "/public/home/znwlzx_test/data/cjx/mmdetection3d/mmdet3d/datasets/custom_3d.py", line 64, in init self.data_infos = self.load_annotations(self.ann_file)self.data_infos = self.load_annotations(self.ann_file)

File "/public/home/znwlzx_test/data/cjx/UniAD/projects/mmdet3d_plugin/datasets/nuscenes_e2e_dataset.py", line 152, in load_annotations File "/public/home/znwlzx_test/data/cjx/UniAD/projects/mmdet3d_plugin/datasets/nuscenes_e2e_dataset.py", line 152, in load_annotations data = pickle.loads(self.file_client.get(ann_file.name))data = pickle.loads(self.file_client.get(ann_file.name))

AttributeError: 'str' object has no attribute 'name'

During handling of the above exception, another exception occurred:

AttributeError: 'str' object has no attribute 'name'Traceback (most recent call last):

During handling of the above exception, another exception occurred:

File "./tools/train.py", line 256, in Traceback (most recent call last): File "./tools/train.py", line 256, in main()
main() File "./tools/train.py", line 219, in main File "./tools/train.py", line 219, in main datasets = [build_dataset(cfg.data.train)] datasets = [build_dataset(cfg.data.train)] File "/public/home/znwlzx_test/data/cjx/mmdetection3d/mmdet3d/datasets/builder.py", line 41, in build_dataset

File "/public/home/znwlzx_test/data/cjx/mmdetection3d/mmdet3d/datasets/builder.py", line 41, in build_dataset dataset = build_from_cfg(cfg, DATASETS, default_args) File "/public/home/znwlzx_test/.conda/envs/cjx/lib/python3.8/site-packages/mmcv/utils/registry.py", line 55, in build_from_cfg dataset = build_from_cfg(cfg, DATASETS, default_args) File "/public/home/znwlzx_test/.conda/envs/cjx/lib/python3.8/site-packages/mmcv/utils/registry.py", line 55, in build_from_cfg raise type(e)(f'{obj_cls.name}: {e}') AttributeError: NuScenesE2EDataset: 'str' object has no attribute 'name'
raise type(e)(f'{obj_cls.name}: {e}') AttributeError: NuScenesE2EDataset: 'str' object has no attribute 'name'

sdc-sdd avatar Mar 20 '25 05:03 sdc-sdd

have you solved the problem?

caixinxuan avatar May 07 '25 09:05 caixinxuan

I‘ve had this problem as well. "pickle.loads(self.file_client.get(ann_file.name))", find this line and rename ann_file.name -> ann_file

WanG1524 avatar May 23 '25 02:05 WanG1524