Open ammaryasirnaich opened 2 years ago
Hi, I have the same error :( Did you find a solution for it? If so, could you please share it? Thanks in advance :)
Hi, I have the same error :( Did you find a solution for it? If so, could you please share it? Thanks in advance :)
Sorry @ApoorvaSuresh still waiting for help. I have no idea what is causing it !
Have you ever tried our pretrained models? Maybe your trained models are not good enough and produce no predictions, which causes the input.numel() == 0.
@Tai-Wang thanks for your response. I will try once again to re-check with the pre-trained model. However, the re-trained models show more than 72% mAP on Hard, medium, and easy modes.
You can add a breakpoint in the show function and have a look at why the input.numel() == 0. I guess it might be compatible for no predictions during evaluation while not for visualization.
@Tai-Wang , i am getting the same error with the pre-trained model
File "mmdetection3d/tools/test.py", line 260, in <module>
main()
File "mmdetection3d/tools/test.py", line 230, in main
outputs = single_gpu_test(model, data_loader, args.show, args.show_dir)
File "/workspace/mmdetection3d/mmdet3d/apis/test.py", line 48, in single_gpu_test
model.module.show_results(
File "/workspace/mmdetection3d/mmdet3d/models/detectors/base.py", line 120, in show_results
show_result(
File "/workspace/mmdetection3d/mmdet3d/core/visualizer/show_result.py", line 110, in show_result
0, 255, size=(pred_labels.max() + 1, 3)) / 256
RuntimeError: max(): Expected reduction dim to be specified for input.numel() == 0. Specify the reduction dim with the 'dim' argument.
One thing more, I think the pre-trained models must have been trained on spconv1.0. But I have spconv2.0 with my environment is it going to be some mismatch issue because as the model starts I also get the following messing in the terminal
load checkpoint from local path: /workspace/working_dir/hv_second_secfpn.pth
The model and loaded state dict do not match exactly
size mismatch for middle_encoder.conv_input.0.weight: copying a param with shape ('middle_encoder.conv_input.0.weight', torch.Size([16, 3, 3, 3, 4])) from checkpoint,the shape in current model is torch.Size([16, 3, 3, 3, 128]).
missing keys in source state_dict: voxel_encoder.vfe_layers.0.norm.weight, voxel_encoder.vfe_layers.0.norm.bias, voxel_encoder.vfe_layers.0.norm.running_mean, voxel_encoder.vfe_layers.0.norm.running_var, voxel_encoder.vfe_layers.0.linear.weight, voxel_encoder.vfe_layers.1.norm.weight, voxel_encoder.vfe_layers.1.norm.bias, voxel_encoder.vfe_layers.1.norm.running_mean, voxel_encoder.vfe_layers.1.norm.running_var, voxel_encoder.vfe_layers.1.linear.weight
One thing more, I think the pre-trained models must have been trained on spconv1.0. But I have spconv2.0 with my environment is it going to be some mismatch issue because as the model starts I also get the following messing in the terminal
load checkpoint from local path: /workspace/working_dir/hv_second_secfpn.pth The model and loaded state dict do not match exactly size mismatch for middle_encoder.conv_input.0.weight: copying a param with shape ('middle_encoder.conv_input.0.weight', torch.Size([16, 3, 3, 3, 4])) from checkpoint,the shape in current model is torch.Size([16, 3, 3, 3, 128]). missing keys in source state_dict: voxel_encoder.vfe_layers.0.norm.weight, voxel_encoder.vfe_layers.0.norm.bias, voxel_encoder.vfe_layers.0.norm.running_mean, voxel_encoder.vfe_layers.0.norm.running_var, voxel_encoder.vfe_layers.0.linear.weight, voxel_encoder.vfe_layers.1.norm.weight, voxel_encoder.vfe_layers.1.norm.bias, voxel_encoder.vfe_layers.1.norm.running_mean, voxel_encoder.vfe_layers.1.norm.running_var, voxel_encoder.vfe_layers.1.linear.weight
The pretrained models of SECOND are not updated after the coordinate system refactoring. For now, you can try PointPillars with our provided models or train your own SECOND models with our provided configs.
But @Tai-Wan at the first instant got the mentioned (Posted title) error while training the own SECOND model with your provided configs!
@Tai-Wang , @ZCMax did you had a chance to further investigate the issue that I have used raised:
1 ) Gives the same error with the pre-trained model
with the given config file
2) Gives the same error after retraining the model
with the given config file
It work fine when i run it with the following command
python tools/test.py workspace/mmdetection3d/configs/second/mmdetection3d/hv_second_secfpn_fp16_6x8_80e_kitti-3d-car.py /workspace/mmdetection3d/working_dir/hv_second_kitti-3d-car.pth --eval 'mAP' --eval-options 'show=True' 'out_dir=/workspace/mmdetection3d/working_dir/show_results'
One thing more, I think the pre-trained models must have been trained on spconv1.0. But I have spconv2.0 with my environment is it going to be some mismatch issue because as the model starts I also get the following messing in the terminal
load checkpoint from local path: /workspace/working_dir/hv_second_secfpn.pth The model and loaded state dict do not match exactly size mismatch for middle_encoder.conv_input.0.weight: copying a param with shape ('middle_encoder.conv_input.0.weight', torch.Size([16, 3, 3, 3, 4])) from checkpoint,the shape in current model is torch.Size([16, 3, 3, 3, 128]). missing keys in source state_dict: voxel_encoder.vfe_layers.0.norm.weight, voxel_encoder.vfe_layers.0.norm.bias, voxel_encoder.vfe_layers.0.norm.running_mean, voxel_encoder.vfe_layers.0.norm.running_var, voxel_encoder.vfe_layers.0.linear.weight, voxel_encoder.vfe_layers.1.norm.weight, voxel_encoder.vfe_layers.1.norm.bias, voxel_encoder.vfe_layers.1.norm.running_mean, voxel_encoder.vfe_layers.1.norm.running_var, voxel_encoder.vfe_layers.1.linear.weight
This ”mismatch“ problem also happened to me. How to fix it?
@jialeli1 actually i didn't solve my mismatch problem. It only solved the RuntimeError:max() issue. The pre-trained model for the config hv_second_secfpn_6x8_80e_kitti-3d-3class.py
is working, however but if you retraining the model and do the evaluations the model keeps giving size mismatch for middle_encoder.conv_input.0.weight
. I am also waiting for help
Is it possible to hotfix this by replacing the line in https://github.com/open-mmlab/mmdetection3d/blob/073f353cf21d31beabcbffa45bef10a6f81abff3/mmdet3d/core/visualizer/show_result.py#L106 with
if pred_labels is None or pred_labels.numel() == 0
?
是否可以通过替换中的行来修复此问题
和
if pred_labels is None or pred_labels.numel() == 0
?
i have solved this error with your suggestion ,thks so much
Hi, I am testing the pre-trainined second model along with visualization running the command :
However, in the
000005
instance it gets a Runtime Error.My working environment is:
Will much appreciate for a help !