EuphoriaYan / zi2zi-pytorch

zi2zi implement with pytorch
192 stars 43 forks source link

训练报错 #25

Closed jilieryuyi closed 2 years ago

jilieryuyi commented 2 years ago

unpickled total 0 examples unpickled total 8517 examples Traceback (most recent call last): File "train.py", line 128, in main() File "train.py", line 102, in main for bid, batch in enumerate(dataloader): File "D:\PaddleGAN-venv\lib\site-packages\torch\utils\data\dataloader.py", line 521, in next data = self._next_data() File "D:\PaddleGAN-venv\lib\site-packages\torch\utils\data\dataloader.py", line 561, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "D:\PaddleGAN-venv\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\PaddleGAN-venv\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\code\zi2zi-pytorch-master\data\dataset.py", line 35, in getitem img_A, img_B = self.process(item[1]) File "D:\code\zi2zi-pytorch-master\data\dataset.py", line 102, in process img_A = self.transform(img_A) File "D:\PaddleGAN-venv\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "D:\PaddleGAN-venv\lib\site-packages\torchvision\transforms\transforms.py", line 226, in forward

return F.normalize(tensor, self.mean, self.std, self.inplace)

File "D:\PaddleGAN-venv\lib\site-packages\torchvision\transforms\functional.py", line 351, in normali ze tensor.sub(mean).div(std) RuntimeError: output with shape [1, 256, 256] doesn't match the broadcast shape [3, 256, 256]

求教下,怎么调整?

huakey commented 2 years ago

RuntimeError: output with shape [1, 256, 256] doesn't match the broadcast shape [3, 256, 256]

求教下,怎么调整? @jilieryuyi