StreamPETR
StreamPETR copied to clipboard
KeyError: 'Petr3D_seg: "PETRHead_seg: \'SinePositionalEncoding3D is not in the position encoding registry\'"'
When i try to add the segmentation task from PETRv2 to StreamPETR, i put【petrv2_ BEVseg.py, petr3d_Seg. py, petr_head_seg.py】 in the corresponding location under the StreamPETR project, i also add 【from .petr3d_seg import Petr3D_seg】in 【StreamPETR/projects/mmdet3d_plugin/models/detectors/init.py】,add 【from .petr_head_seg import PETRHead_seg】in 【StreamPETR/projects/mmdet3d_plugin/models/dense_heads/init.py】, but when running the training command, the following error occurred
Traceback (most recent call last): File "/home/cxh/anaconda3/envs/streampetrobse/lib/python3.8/site-packages/mmcv/utils/registry.py", line 69, in build_from_cfg return obj_cls(**args) File "/home/cxh/StreamPETR/projects/mmdet3d_plugin/models/dense_heads/petr_head_seg.py", line 319, in init self.positional_encoding = build_positional_encoding( File "/home/cxh/anaconda3/envs/streampetrobse/lib/python3.8/site-packages/mmcv/cnn/bricks/transformer.py", line 40, in build_positional_encoding return build_from_cfg(cfg, POSITIONAL_ENCODING, default_args) File "/home/cxh/anaconda3/envs/streampetrobse/lib/python3.8/site-packages/mmcv/utils/registry.py", line 61, in build_from_cfg raise KeyError( KeyError: 'SinePositionalEncoding3D is not in the position encoding registry'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/cxh/anaconda3/envs/streampetrobse/lib/python3.8/site-packages/mmcv/utils/registry.py", line 69, in build_from_cfg return obj_cls(**args) File "/home/cxh/StreamPETR/projects/mmdet3d_plugin/models/detectors/petr3d_seg.py", line 55, in init super(Petr3D_seg, self).init(pts_voxel_layer, pts_voxel_encoder, File "/home/cxh/mmdetection3d/mmdet3d/models/detectors/mvx_two_stage.py", line 62, in init self.pts_bbox_head = builder.build_head(pts_bbox_head) File "/home/cxh/mmdetection3d/mmdet3d/models/builder.py", line 68, in build_head return MMDET_HEADS.build(cfg) File "/home/cxh/anaconda3/envs/streampetrobse/lib/python3.8/site-packages/mmcv/utils/registry.py", line 237, in build return self.build_func(*args, **kwargs, registry=self) File "/home/cxh/anaconda3/envs/streampetrobse/lib/python3.8/site-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "/home/cxh/anaconda3/envs/streampetrobse/lib/python3.8/site-packages/mmcv/utils/registry.py", line 72, in build_from_cfg raise type(e)(f'{obj_cls.name}: {e}') KeyError: "PETRHead_seg: 'SinePositionalEncoding3D is not in the position encoding registry'"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tools/train.py", line 263, in
INFO:torch.distributed.elastic.agent.server.api:[default] Starting worker group INFO:torch.distributed.elastic.multiprocessing:Setting worker0 reply file to: /tmp/torchelastic_p5ihn_in/none_xinnk_5z/attempt_1/0/error.json projects.mmdet3d_plugin how to deal with it???looking forward to your reply
你好,我也在做这个工作,请问你那边完成了吗?
@GuuuuuG 您好,没有呢 请问您做出来了吗
@chenxinhe1 https://github.com/exiawsh/StreamPETR/blob/main/projects/mmdet3d_plugin/models/utils/positional_encoding.py 我的代码没有实现SinePositionalEncoding3D,你需要把PETR中的相关实现拷贝进来