rosinality / vq-vae-2-pytorch

Implementation of Generating Diverse High-Fidelity Images with VQ-VAE-2 in PyTorch
Other
1.65k stars 275 forks source link

Error on train_pixelsnail.py after last update #6

Closed Corea closed 5 years ago

Corea commented 5 years ago

Error message is given below :

Traceback (most recent call last):
  File "train_pixelsnail.py", line 138, in <module>
    train(args, i, loader, model, optimizer, scheduler, device)
  File "train_pixelsnail.py", line 34, in train
    loss = criterion(out, target)
  File "/home/corey/.virtualenvs/vq-vae-2-pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/corey/.virtualenvs/vq-vae-2-pytorch/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 942, in forward
    ignore_index=self.ignore_index, reduction=self.reduction)
  File "/home/corey/.virtualenvs/vq-vae-2-pytorch/lib/python3.6/site-packages/torch/nn/functional.py", line 2056, in cross_entropy
    return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
  File "/home/corey/.virtualenvs/vq-vae-2-pytorch/lib/python3.6/site-packages/torch/nn/functional.py", line 1350, in log_softmax
    ret = input.log_softmax(dim)
AttributeError: 'tuple' object has no attribute 'log_softmax'

In last commit, function signature of PixelSNAIL.foward was updated and this affects this part of code.

rosinality commented 5 years ago

Fixed at fa789318d054f7bb315aa0eb6469298942f1ae6b. Sorry for being late.