Po-Hsun-Su / pytorch-ssim

pytorch structural similarity (SSIM) loss
Other
1.87k stars 364 forks source link

RuntimeError window is not contiguous #2

Closed waleedgondal closed 6 years ago

waleedgondal commented 6 years ago

I tried using your code. However, it returns RuntimeError of window being non contiguous. More explicitly

RuntimeError: cuDNN requires contiguous weight tensor

I put a check of window.is_contiguous() which returns 'False'. Therefore, I tried making it contiguous by window.contiguous() but then I get a different error stating

RuntimeError: tensors are on different GPUs

However, I have only one GPU.

waleedgondal commented 6 years ago

It turns out that the window has to be transferred to gpu first before making it a variable. I have introduced the check to solve this