-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue with basic usage example #36
Comments
@Alok589 I had the same problem because I used pip to install this repo as a package. I just have to clone this repo, then copy pytorch_ssim folder from this repo (repo and folder have the same name - maybe it is a reason why we misunderstood) to your directory as follow: |
For anyone having same issue in the future. |
@Alok589 to make it work on COLAB:
|
Hi,
I am not able to run the example script. Could you please let me know what is missing?
basic usage script :
import pytorch_ssim
import torch
from torch.autograd import Variable
img1 = Variable(torch.rand(1, 1, 256, 256))
img2 = Variable(torch.rand(1, 1, 256, 256))
if torch.cuda.is_available():
img1 = img1.cuda()
img2 = img2.cuda()
print(pytorch_ssim.ssim(img1, img2))
ssim_loss = pytorch_ssim.SSIM(window_size=4)
print(ssim_loss(img1, img2))
here is the traceback of the code:
Traceback (most recent call last):
File "/home/thesis_2/ssim_test.py", line 12, in
print(pytorch_ssim.ssim(img1, img2))
File "/opt/conda/envs/venv/lib/python3.6/site-packages/pytorch_ssim/init.py", line 62, in ssim
return _ssim(img1, img2, window, window_size, channel, size_average)
File "/opt/conda/envs/venv/lib/python3.6/site-packages/pytorch_ssim/init.py", line 18, in _ssim
mu1 = F.conv2d(img1, window, padding = window_size/2, groups = channel)
TypeError: conv2d(): argument 'padding' must be tuple of ints, not float
The text was updated successfully, but these errors were encountered: