znxlwm / UGATIT-pytorch

Official PyTorch implementation of U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Image Translation
MIT License
2.51k stars 476 forks source link

var(): argument 'dim' must be int, not list #38

Open dxm343488059 opened 4 years ago

dxm343488059 commented 4 years ago

torch.mean(input, dim=[2, 3], keepdim=True), torch.var(input, dim=[2, 3], keepdim=True)

Modify the code so that it resembles the following code sample:

torch.mean(torch.mean(input, dim=2, keepdim=True), dim=3, keepdim=True), torch.var(torch.var(input, dim=2, keepdim=True), dim=3, keepdim=True)

AstomMars commented 4 years ago

It works, thanks a lot. The problem seems to be that version of pytorch is too old.