akanimax / pro_gan_pytorch

Unofficial PyTorch implementation of the paper titled "Progressive growing of GANs for improved Quality, Stability, and Variation"
MIT License
536 stars 100 forks source link

square() not exist? #50

Closed GaoFengs closed 2 years ago

GaoFengs commented 3 years ago

AttributeError: 'Tensor' object has no attribute 'square'

y = torch.reshape(x, [group_size, -1, channels, height, width]) y = torch.sqrt(y.square().mean(dim=0, keepdim=False) + alpha)

square() not exist?

GaoFengs commented 3 years ago

Please help me!!!

jyu-theartofml commented 2 years ago

Have you tried torch.square(y)?

akanimax commented 2 years ago

Yeah I remember this to be a puny PyTorch version error. I tested the code last with Torch 1.7.1. Perhaps square has been removed in the newer version or the other way around. I'll add the dependency requirements soon. :+1:

akanimax commented 2 years ago

For now, either switch to a version which has this function, or replace in the code y ** 2 or equivivalent.