Skip to content
Advertisement

ValueError when using vae.fit in Keras

I am creating a vae model over the mnist dataset with hopes of plotting the loss function against the epochs. However I am experiencing some issues and was unable to find a solution online. During my imports I have the following imports (just to give some context to the code):

JavaScript

I have also created a function called bn for my own loss calculations and the class KLDivergenceLayer that adds a KL divergence layer to the final model loss.

Code:

JavaScript

and the error I get back to me is as follows:

JavaScript

Advertisement

Answer

The problem is in your eps layer. it’s not a model input

you can substitute it with a simple layer like this one:

JavaScript

here u can find the running notebook:

https://colab.research.google.com/drive/1fLmfwCA_TOeOlXiiSabp4C4UKq73ofEN?usp=sharing

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement