You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hey i'm trying to load image 128x128 and i have resized it into 64x64 in data_loader but i still get this error
Traceback (most recent call last):
File "train_gan.py", line 245, in
args.restore_file,cuda_id=cuda_id)
File "train_gan.py", line 127, in train_and_evaluate
train(netG, netD, optimG, optimD, loss_fn, train_dataloader, metrics, params, cuda_id)
File "train_gan.py", line 66, in train
g_loss = loss_fn(fake_out, fake_img, real_img)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "F:\ProgramTA\CGAN_AinilMardiah\program\loss.py", line 78, in forward
perception_loss = self.mse_loss(self.loss_network(out_images), self.loss_network(target_images))
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\modules\loss.py", line 421, in forward
return F.mse_loss(input, target, reduction=self.reduction)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\functional.py", line 1716, in mse_loss
return _pointwise_loss(lambda a, b: (a - b) ** 2, torch._C._nn.mse_loss, input, target, reduction)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\functional.py", line 1674, in _pointwise_loss
return lambd_optimized(input, target, reduction)
RuntimeError: input and target shapes do not match: input [16 x 512 x 8 x 8], target [16 x 512 x 2 x 2] at c:\programdata\miniconda3\conda-bld\pytorch_1532505617613\work\aten\src\thcunn\generic/MSECriterion.cu:12
could help me how to solve the error?
The text was updated successfully, but these errors were encountered:
hey i'm trying to load image 128x128 and i have resized it into 64x64 in data_loader but i still get this error
Traceback (most recent call last):
File "train_gan.py", line 245, in
args.restore_file,cuda_id=cuda_id)
File "train_gan.py", line 127, in train_and_evaluate
train(netG, netD, optimG, optimD, loss_fn, train_dataloader, metrics, params, cuda_id)
File "train_gan.py", line 66, in train
g_loss = loss_fn(fake_out, fake_img, real_img)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "F:\ProgramTA\CGAN_AinilMardiah\program\loss.py", line 78, in forward
perception_loss = self.mse_loss(self.loss_network(out_images), self.loss_network(target_images))
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\modules\loss.py", line 421, in forward
return F.mse_loss(input, target, reduction=self.reduction)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\functional.py", line 1716, in mse_loss
return _pointwise_loss(lambda a, b: (a - b) ** 2, torch._C._nn.mse_loss, input, target, reduction)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\functional.py", line 1674, in _pointwise_loss
return lambd_optimized(input, target, reduction)
RuntimeError: input and target shapes do not match: input [16 x 512 x 8 x 8], target [16 x 512 x 2 x 2] at c:\programdata\miniconda3\conda-bld\pytorch_1532505617613\work\aten\src\thcunn\generic/MSECriterion.cu:12
could help me how to solve the error?
The text was updated successfully, but these errors were encountered: