MPRNet
MPRNet copied to clipboard
有大佬知道cuda:0 device type tensor to numpy怎么解决
can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
What exactly is the error
在tensor变量后面加.cpu()
i changed it in lines 120-121 :
# Compute loss at each stage
loss_char = torch.sum(torch.stack([criterion_char(restored[j], target) for j in range(len(restored))]))
loss_edge = torch.sum(torch.stack([criterion_edge(restored[j], target) for j in range(len(restored))]))
loss = (loss_char) + (0.05*loss_edge)
and it's worked
i changed it in lines 120-121 :
# Compute loss at each stage loss_char = torch.sum(torch.stack([criterion_char(restored[j], target) for j in range(len(restored))])) loss_edge = torch.sum(torch.stack([criterion_edge(restored[j], target) for j in range(len(restored))])) loss = (loss_char) + (0.05*loss_edge)
and it's worked
It works! Thank you!
请问下改了这里之后你们训练会遇到损失降不下来的情况吗?我PSNR一直上不去,后面训练的都不如前面的很低很低,这是什么情况呢?