I tried to implement VAE for a custom dataset.
Information about the problem and the dataset.
- Image dataset with each image resized to 200*200 and has 23 classes
- Each image can belong to multiple class at the same time( Multi label)
- I have a train and test data loader set up, getitem gives a tensor and label tensor with necessary transforms already done.
I modified the shape in the encoder and decoder from the MNIST example ( instead of 28 X 28 = 784, i have modified it as 200 X 200 = 40000).
When i run inference, i get nan training loss and testing loss at the second epoch (sometimes from the first epoch) . (This works only when i make the images grayscale and squeeze the channel dimension itself)
[epoch 000] average training loss: 13551.6894 [epoch 000] average test loss: 7712.9928 /home/mancunian92/anaconda3/lib/python3.6/site-packages/pyro/infer/trace_elbo.py:138: UserWarning: Encountered NaN: loss warn_if_nan(loss, "loss") [epoch 001] average training loss: nan [epoch 002] average training loss: nan
- For multi label images , what modifications should i make ?
- Right now i have converted the images to grayscale, what should i do if i have to keep it in rgb ?