Machine-Learning-Collection
Machine-Learning-Collection copied to clipboard
fixed tensor size issue
RuntimeError: The size of tensor a (78) must match the size of tensor b (64) at non-singleton dimension 2
printing the shape of tensors real and fake inside of the gradient_penalty function in utils.py (directly before the images are interpolated) shows that real has height of 78 instead of 64. real = torch.Size([64, 3, 78, 64]) fake = torch.Size([64, 3, 64, 64])
Fixed the issue by changing transforms.Resize in train.py from transforms.Resize(IMAGE_SIZE) to transforms.Resize((IMAGE_SIZE, IMAGE_SIZE))