HorizonRobotics / Sparse4D

MIT License
326 stars 31 forks source link

尝试复现训练和评测的时候报错 #86

Open WuYiYiYi opened 3 months ago

WuYiYiYi commented 3 months ago

hello,非常感谢您的开源,在我按照quick_start.md尝试运行的时候遇到了以下几个问题,向您请教下:

  1. train

    bash local_train.sh sparse4dv3_temporal_r50_1x8_bs6_256x704 执行的时候报错: File "/home/amax/workspace/sourc_code/Sparse4D-main/projects/mmdet3d_plugin/models/sparse4d_head.py", line 456, in loss reg_loss = self.loss_reg( File "/home/amax/anaconda3/envs/bevformer/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, *kwargs) File "/home/amax/workspace/sourc_code/Sparse4D-main/projects/mmdet3d_plugin/models/detection3d/losses.py", line 66, in forward box_loss = self.loss_box( File "/home/amax/anaconda3/envs/bevformer/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "/home/amax/anaconda3/envs/bevformer/lib/python3.8/site-packages/mmdet/models/losses/smooth_l1_loss.py", line 138, in forward loss_bbox = self.loss_weight l1_loss( File "/home/amax/anaconda3/envs/bevformer/lib/python3.8/site-packages/mmcv/utils/parrots_jit.py", line 22, in wrapper_inner return func(args, kargs) File "/home/amax/anaconda3/envs/bevformer/lib/python3.8/site-packages/mmdet/models/losses/utils.py", line 96, in wrapper loss = loss_func(pred, target, **kwargs) File "/home/amax/anaconda3/envs/bevformer/lib/python3.8/site-packages/mmdet/models/losses/smooth_l1_loss.py", line 43, in l1_loss assert pred.size() == target.size() and target.numel() > 0 debug发现reg和reg_target都是空,导致计算loss的时候报错,尝试调整config中cls_threshold_to_reg=0.02可以解决,请问原配置0.05的阈值是怎么设置的呢?您有遇到相同的问题吗?

  2. test

    bash local_test.sh sparse4dv3_temporal_r50_1x8_bs6_256x704 ckpt/sparse4dv3_r50.pth 这里的checkpoint用的是您release的版本, 报错: File "/home/amax/anaconda3/envs/bevformer/lib/python3.8/site-packages/mmdet/models/backbones/resnet.py", line 635, in forward x = self.conv1(x) #val: [1,1,6,3,256,704] train:[36,3,256,704] File "/home/amax/anaconda3/envs/bevformer/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/home/amax/anaconda3/envs/bevformer/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 446, in forward return self._conv_forward(input, self.weight, self.bias) File "/home/amax/anaconda3/envs/bevformer/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 442, in _conv_forward return F.conv2d(input, weight, bias, self.stride, RuntimeError: Expected 4-dimensional input for 4-dimensional weight [64, 3, 7, 7], but got 6-dimensional input of size [1, 6, 6, 3, 256, 704] instead 十分期待您的答复,感谢!