yeyun111 / dlcv_for_beginners

《深度学习与计算机视觉》配套代码
https://frombeijingwithlove.github.io/dlcv_for_beginners/
BSD 3-Clause "New" or "Revised" License
1.44k stars 639 forks source link

运行出错python gan_demo.py --cpu inputs/zig.jpg #33

Open maxbest opened 5 years ago

maxbest commented 5 years ago

$ python gan_demo.py --cpu inputs/zig.jpg C:\Users\Administrator\Anaconda3\envs\torchcpu\lib\site-packages\torch\nn\functional.py:1386: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigm oid instead. warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.") C:\Users\Administrator\Anaconda3\envs\torchcpu\lib\site-packages\torch\nn\modules\loss.py:512: UserWarning: Using a target size (torch.Size([2000])) that is d ifferent to the input size (torch.Size([2000, 1])) is deprecated. Please ensure they have the same size. return F.binary_cross_entropy(input, target, weight=self.weight, reduction=self.reduction) Traceback (most recent call last): File "gan_demo.py", line 88, in loss_d_real = d_real_loss.data.cpu().numpy()[0] if cuda else d_real_loss.data.numpy()[0] IndexError: too many indices for array

allenu2 commented 4 years ago

I have a similar problem, did you solve it?