zhenyuw16 / Uni3DETR

Code release for our NeurIPS 2023 paper "Uni3DETR: Unified 3D Detection Transformer", our ECCV 2024 paper "OV-Uni3DETR: Towards Unified Open-Vocabulary 3D Object Detection via Cycle-Modality Propagation"
Apache License 2.0
84 stars 3 forks source link

can not load the checkpoint. #2

Open zyrant opened 1 year ago

zyrant commented 1 year ago

hello

I want to use the uni3detr_scannet_large.py and uni3detr_scannet.pth to test the performance on scannet. but it occurs

File "/opt/data/private/tr3d/projects5/mmdet3d_plugin/models/pts_encoder/sparse_encoder_hd.py", line 123, in forward
    x = self.conv_input(input_sp_tensor)
  File "/home/miniconda3/envs/tr3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/miniconda3/envs/tr3d/lib/python3.8/site-packages/spconv/pytorch/modules.py", line 138, in forward
    input = module(input)
  File "/home/miniconda3/envs/tr3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/miniconda3/envs/tr3d/lib/python3.8/site-packages/spconv/pytorch/conv.py", line 755, in forward
    return self._conv_forward(self.training,
  File "/home/miniconda3/envs/tr3d/lib/python3.8/site-packages/spconv/pytorch/conv.py", line 169, in _conv_forward
    assert input.features.shape[
AssertionError: channel size mismatch

I noticed that https://github.com/zhenyuw16/Uni3DETR/blob/9ad229a8cd8ee55ae787c449a2923e3d336b4ee0/projects/configs/uni3detr/uni3detr_scannet_large.py#L185 only loading 3 dims(xyz) but in https://github.com/zhenyuw16/Uni3DETR/blob/9ad229a8cd8ee55ae787c449a2923e3d336b4ee0/projects/configs/uni3detr/uni3detr_scannet.py#L34 in_channels is 4, so this problem occurs, I'm curious what do you use for the fourth dimension feature?

Any help you can provide I would be very grateful.

Thanks.

zhenyuw16 commented 1 year ago

We do not use the fourth dimension so it does not affect the performance. Since the pre-trained model is trained under this config, so the in_channels is still 4 in the config file. We do not use the spconv library, so perhaps uninstalling the spconv library can solve this error.

zyrant commented 1 year ago

thanks, i will have a try.