From 9a6806fd2186db90f8745cda6a299d50aae3c509 Mon Sep 17 00:00:00 2001 From: Arseny <94837013+Cyber-Zhaba@users.noreply.github.com> Date: Mon, 28 Aug 2023 02:25:56 +0300 Subject: [PATCH] fixed 64x78 Image probllem While i was playing with WGAN-gp i faced up RunTime Error that appeared in gradient_penalty function. It turns out transforms.Resize(64) sometimes will produce images like 64x78, so change it to transforms.Resize((64, 64)) --- ML/Pytorch/GANs/4. WGAN-GP/train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ML/Pytorch/GANs/4. WGAN-GP/train.py b/ML/Pytorch/GANs/4. WGAN-GP/train.py index 1b23c77c..f1fe4f5c 100644 --- a/ML/Pytorch/GANs/4. WGAN-GP/train.py +++ b/ML/Pytorch/GANs/4. WGAN-GP/train.py @@ -33,7 +33,7 @@ transforms = transforms.Compose( [ - transforms.Resize(IMAGE_SIZE), + transforms.Resize((IMAGE_SIZE, IMAGE_SIZE)), transforms.ToTensor(), transforms.Normalize( [0.5 for _ in range(CHANNELS_IMG)], [0.5 for _ in range(CHANNELS_IMG)]