taoxugit / AttnGAN

MIT License
1.33k stars 420 forks source link

issue with training "bird_attnDCGAN2.yml" #77

Closed weili-git closed 4 years ago

weili-git commented 4 years ago

Traceback (most recent call last): File "/AttnGAN-master3/code/main.py", line 140, in algo.train() File "\AttnGAN-master3\code\trainer.py", line 285, in train sent_emb, real_labels, fake_labels) File "\AttnGAN-master3\code\miscc\losses.py", line 143, in discriminator_loss cond_real_logits = netD.COND_DNET(real_features, conditions) File "\Anaconda3\envs\torch-env\lib\site-packages\torch\nn\modules\module.py", line 489, in call result = self.forward(*input, **kwargs) File "\AttnGAN-master3\code\model.py", line 567, in forward h_c_code = torch.cat((h_code, c_code), 1) RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 4 and 1 in dimension 2 at c:\a\w\1\s\tmp_conda_3.6_091443\conda\conda-bld\pytorch_1544087948354\work\aten\src\thc\generic/THCTensorMath.cu:83

Process finished with exit code 1

Training using config file "bird_attn2.yml" worked normally, but when I tried to use DCGAN version, it failed with errors above.

weili-git commented 4 years ago

I fixed it by setting config.py "__C.GAN.B_DCGAN = True"