aitorzip / PyTorch-CycleGAN

A clean and readable Pytorch implementation of CycleGAN
https://arxiv.org/abs/1703.10593
GNU General Public License v3.0
1.19k stars 283 forks source link

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

Closed youngjaeshin closed 4 years ago

youngjaeshin commented 4 years ago

Thanks for providing great codes for cycleGAN. Firstly, I changed code in models.py return F.avg_pool2d(x, x.size()[2:]).view(x.size()[0],-1) -> remove -1 because of UserWarning: Using a target size (torch.Size([1])) that is different to the input size (torch.Size([1, 1])) issue. After I fix it, I got another issue 'RuntimeError: output with shape [1, 256, 256] doesn't match the broadcast shape [3, 256, 256]'

Could you comment on this issue?

lxycopper commented 4 years ago

I met with the same probelm, waiting for comments.

Lornatang commented 4 years ago

@youngjaeshin @lxycopper This error will be thrown if the image format is not correct when reading the image. My solution is to delete some abnormal pictures. If you need, I will send the processed data set to Baidu cloud.

wbchief commented 4 years ago

Now I also meet the problem, Can you send the processed data set to me? Thanks. @Lornatang

Lornatang commented 4 years ago

You just need to download the link, put it in the 'dataset' directory, and extract it. url: https://pan.baidu.com/s/1mRF9Ft3aUG_DB1aW4793-Q passwd: ebvt You can refer to my project modified by the author, which is more easy to use and readable. See CycleGAN_PyTorch

wbchief commented 4 years ago

Thanks.

alexander-soare commented 4 years ago

@Lornatang thanks for this. Could I ask what the actual formatting issues were?

Lornatang commented 4 years ago

@alexander-soare Channel error of image, non-standard RGB format.

ZunxiaoXu commented 3 years ago

@Lornatang I’m sorry to find that the link you shared is invalid. Could you please share it again, thank you very much

Lornatang commented 3 years ago

@893205894 Link:https://pan.baidu.com/s/1LbxlYed7oHSOJtRWm38y5A passwd:cddr

ZunxiaoXu commented 3 years ago

Thinks!