Open sunnyHelen opened 5 years ago
I have the same error. The results are always 1
Hi,
I had the same problem, but managed to fix it by forcing data type as float. The problem occurred when the input was Byte.
So in my case the fix was simply: tensor = torch.from_numpy(np.array(img, dtype="float32"))
instead of: tensor = torch.from_numpy(np.array(img))
Hi,
I had the same problem, but managed to fix it by forcing data type as float. The problem occurred when the input was Byte.
So in my case the fix was simply:
tensor = torch.from_numpy(np.array(img, dtype="float32"))
instead of:tensor = torch.from_numpy(np.array(img))
perfectly solved my problem. THANKS a lot !
Hi,
I had the same problem, but managed to fix it by forcing data type as float. The problem occurred when the input was Byte.
So in my case the fix was simply:
tensor = torch.from_numpy(np.array(img, dtype="float32"))
instead of:tensor = torch.from_numpy(np.array(img))
Thanks!
I use SSIM as a loss, but it seems always = 1. I try to print ssim_map. It's all one. I make sure my two img is not the same. Their L1 distance isn't zero. I don't know where the error is. Could you please help me?