junyanz/pytorch-CycleGAN-and-pix2pix

RunTimeError : Size of Tensros must match except in dimension 1

Jiwno opened this issue · 1 comments

Hi, I'm having trouble with training pix2pix model with my data.
I have a run time error that I've never seen it before when I use other datasets.
is there any solution to figure this out?

python train.py --dataroot .\datasets\soolsool_5760_2880_60_30 --name soolsool_v1 --model pix2pix --direction BtoA --load_size 1440 --crop_size 1440 --preprocess none --no_dropout --input_nc 4 --output_nc 4

error message : Sizes of tensors must match except in dimension 1. Expected size 45 but got size 44 for tensor number 1 in the list.

File "D:\04_pix2pix\pytorch-CycleGAN-and-pix2pix-master\models\pix2pix_model.py", line 117, in optimize_parameters
self.forward() # compute fake images: G(A)
^^^^^^^^^^^^^^
File "D:\04_pix2pix\pytorch-CycleGAN-and-pix2pix-master\models\pix2pix_model.py", line 88, in forward
self.fake_B = self.netG(self.real_A) # G(A)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\parallel\data_parallel.py", line 184, in forward
return self.module(*inputs[0], **module_kwargs[0])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\04_pix2pix\pytorch-CycleGAN-and-pix2pix-master\models\networks.py", line 466, in forward
return self.model(input)
^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\04_pix2pix\pytorch-CycleGAN-and-pix2pix-master\models\networks.py", line 534, in forward
return self.model(x)
^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\container.py", line 219, in forward
input = module(input)
^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\04_pix2pix\pytorch-CycleGAN-and-pix2pix-master\models\networks.py", line 536, in forward
return torch.cat([x, self.model(x)], 1)
^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\container.py", line 219, in forward
input = module(input)
^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\04_pix2pix\pytorch-CycleGAN-and-pix2pix-master\models\networks.py", line 536, in forward
return torch.cat([x, self.model(x)], 1)
^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\container.py", line 219, in forward
input = module(input)
^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\04_pix2pix\pytorch-CycleGAN-and-pix2pix-master\models\networks.py", line 536, in forward
return torch.cat([x, self.model(x)], 1)
^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\container.py", line 219, in forward
input = module(input)
^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\04_pix2pix\pytorch-CycleGAN-and-pix2pix-master\models\networks.py", line 536, in forward
return torch.cat([x, self.model(x)], 1)
^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\container.py", line 219, in forward
input = module(input)
^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\04_pix2pix\pytorch-CycleGAN-and-pix2pix-master\models\networks.py", line 536, in forward
return torch.cat([x, self.model(x)], 1)
^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\container.py", line 219, in forward
input = module(input)
^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\04_pix2pix\pytorch-CycleGAN-and-pix2pix-master\models\networks.py", line 536, in forward
return torch.cat([x, self.model(x)], 1)
^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\container.py", line 219, in forward
input = module(input)
^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\anaconda3\envs\pix2pix\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\04_pix2pix\pytorch-CycleGAN-and-pix2pix-master\models\networks.py", line 536, in forward
return torch.cat([x, self.model(x)], 1)