IA-SSD icon indicating copy to clipboard operation
IA-SSD copied to clipboard

RuntimeError: Expected isFloatingType(grads[i].type().scalarType()) to be true, but got false.

Open jiangtao129 opened this issue 2 years ago • 3 comments

Dear, A RuntimeError occurred while I was training on the Kitti dataset, as follows

Traceback (most recent call last):
  File "/media/jiangtao/Project/IA-SSD-main/tools/train_utils/train_utils.py", line 52, in train_one_epoch
    loss.backward()

  File "/home/zhang/anaconda3/envs/second1/lib/python3.6/site-packages/torch/tensor.py", line 195, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)

  File "/home/zhang/anaconda3/envs/second1/lib/python3.6/site-packages/torch/autograd/__init__.py", line 99, in backward
    allow_unreachable=True)  # allow_unreachable flag

RuntimeError: Expected isFloatingType(grads[i].type().scalarType()) to be true, but got false.  (Could this error message be improved?  If so, please report an enhancement request to PyTorch.)

Could you please give me the suggestions? Looking forward to your reply.

my environment Ubuntu18.04 Python = 3.6 PyTorch = 1.4 CUDA = 10.2 spconv = 1.2.1

jiangtao129 avatar Jun 21 '22 03:06 jiangtao129

I also met the same problem which let me upset

strugglingguoguo avatar Jun 22 '22 01:06 strugglingguoguo

Have you modified the code? Mine is working perfectly. But I have found this issue, please check if it could help

itskyf avatar Jun 22 '22 10:06 itskyf

I also met the same problem which let me upset

go to IASSD_head.py, find the function def get_loss(self, tb_dict=None), modfiy all the loss values of point_loss from tensor to scalar.For example, change point_loss_box to point_loss_box.item() in function get_center_box_binori_layer_loss.

blueskych avatar Jul 12 '22 02:07 blueskych