I\'m trying to follow the Deep Autoencoder Keras example. I\'m getting a dimension mismatch exception, but for the life of me, I can\'t figure out why. It works when I use
The problem lies in:
# retrieve the last layer of the autoencoder model
decoder_layer = autoencoder.layers[-1]
In previous model - the last layer was the only decoder layer. So it input was also an input to decoder. But right now you have 3 decoding layer so you have to go back to the first one in order to obtain decoder first layer. So changing this line to:
# retrieve the last layer of the autoencoder model
decoder_layer = autoencoder.layers[-3]
Should do the work.