PUGAN-pytorch icon indicating copy to clipboard operation
PUGAN-pytorch copied to clipboard

cannot use EMD_loss

Open Holmes-Alan opened this issue 5 years ago • 1 comments

I tried to use "get_emd_loss" for training but it seems there is a problem with backpropagation.

loss.backward()

File "/home/miniconda3/envs/torch_3d/lib/python3.6/site-packages/torch/tensor.py", line 195, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph) File "/home/miniconda3/envs/torch_3d/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.)

Holmes-Alan avatar Aug 22 '20 09:08 Holmes-Alan

can you specify what is your training dataset? And I think you should try to convert all your input tensor to float type by simply .float(). The information that you provided is limited and I cannot reproduce this currently.

HaolinLiu97 avatar Aug 24 '20 02:08 HaolinLiu97