Closed naomifridman closed 6 years ago
same issue
In fact, the second parameter output_shape
is assigned to but never used. I also think that if there are some mistakes in this example. #6195
if K.image_data_format() == 'channels_first':
output_shape = (batch_size, filters, 29, 29)
else:
output_shape = (batch_size, 29, 29, filters)
Here you can find a discussion about the issue https://github.com/fchollet/keras/pull/5789/files#r106465189. If you want to train VAE, you might get rid of CustomVariationalLayer and just use vae_loss function instead: gist.
Same issue. The same happens with a TensorFlow backend as well.
It looks like the issue was introduced in this commit: https://github.com/fchollet/keras/commit/e8484633473c340defbe03a092be2d4856d56302#diff-3613c97d9863a6854946c967e2b68b7c
I can run the previous versions of variational_autoencoder_deconv.py & variational_autoencoder.py successfully.
Any ideas @Spotlight0xff ?
Not really, I couldn't figure out how to do the loss function using a custom layer, so the maintainer implemented it by himself.
But besides that, upgrading from 2.0.2 to 2.0.4 fixed this issue for me (which I was able to reproduce).
Here is the example in case you're using an older keras version: https://github.com/fchollet/keras/blob/keras-2/examples/variational_autoencoder_deconv.py It's doing the task @Veleslavia mentioned above
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed.
I am trying to run variational_autoencoder_deconv.py on Keras 2.0.2 Theano theano-0.9.0-p. The example is here: https://github.com/fchollet/keras/blob/master/examples/variational_autoencoder_deconv.py I use Anaconda and Jupyter notebook. The source code is:
` The output and errors are: A warning which I don't understand, since input is generated with Input function
/home/naomi/anaconda2/lib/python2.7/site-packages/keras/engine/topology.py:1513: UserWarning: Model inputs must come from a Keras Input layer, they cannot be the output of a previous non-Input layer. Here, a tensor specified as input to "model_20" was not an Input tensor, it was generated by layer custom_variational_layer_20. Note that input tensors are instantiated via
tensor = Input(shape)
. The tensor that caused the issue was: conv2d_19/conv2d_30/conv2d_31/conv2d_60/lambda_18/lambda_19/custom_variational_layer_16/input_55 str(x.name)) /home/naomi/anaconda2/lib/python2.7/site-packages/ipykernel/main.py:134: UserWarning: Output "custom_variational_layer_20" missing from loss dictionary. We assume this was done on purpose, and we will not be expecting any data to be passed to "custom_variational_layer_20" during training.Model Summary
Any help will be appreciated