ritheshkumar95 / pytorch-vqvae

Vector Quantized VAEs - PyTorch Implementation
850 stars 138 forks source link

Not able to train the PixelCNN #9

Closed phmignot closed 3 years ago

phmignot commented 5 years ago

Hello, thanks for your work. I am fighting some issues when training your models. I followed your Instructions.

First, I think you may have forgotten to add '--dataset' argument in both of your commands. Then, I think you forget to import datasets from torchvision in pixelcnn_prior.py.

Eventually, running:

python3 pixelcnn_prior.py --data-folder /tmp/miniimagenet --output-folder models/vqvae --dataset mnist

results in:

AttributeError: 'MNIST' object has no attribute '_label_encoder'

And I have the same issue with CIFAR dataset.

Tinemar commented 5 years ago

Have you solved it? I got the same question.

phmignot commented 5 years ago

No sorry, I ended up just training a VqVae model on my data.

Newbeeer commented 5 years ago

changing n_classes=len(train_dataset._label_encoder) to num_classes=10 would be fine

huangxiao1234 commented 4 years ago

Hello, thanks for your work. I am fighting some issues when training your models. I followed your Instructions.

First, I think you may have forgotten to add '--dataset' argument in both of your commands. Then, I think you forget to import datasets from torchvision in pixelcnn_prior.py.

Eventually, running:

python3 pixelcnn_prior.py --data-folder /tmp/miniimagenet --output-folder models/vqvae --dataset mnist

results in:

AttributeError: 'MNIST' object has no attribute '_label_encoder'

And I have the same issue with CIFAR dataset.

I had the same problem with you in training. The author pixelcnn should only be used for miniimagenet, so import dataset is not needed

prateekm08 commented 4 years ago

I replaced __label_encoder with class_to_idx and it works well. Hope this helps.