Closed gtuzi closed 7 years ago
This seems to be the same problem as #5396.
To reproduce this bug, just try to save the model in the variational autoencoder example here.
This definitely has to do with Lambdas, because if you change line 40 to say "z_mean" instead of "z", this problem goes away.
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.
Hi, I have a model which uses a Merge() layer. The model runs and saves. I am having trouble loading the model again.
merged_layer = Merge(group_out, mode=lambda x: weighted_merge_fun(x, (num_experts, num_classes)),output_shape=(num_classes,))
The error I get is:
After researching some previous issues, I saw that other people had potentially similar issues using the Lambda(). But I didn't get whether there was a solution to this.
I am running into this issue with both Python 2.7/3.5
Update:
I changed the merge layer. Lambda now takes only one argument, and the output shape is literally defined:
merged_layer = Merge(group_out, mode=lambda x: weighted_merge_fun(x), output_shape=(7,))
wheregroup_out
is a list of output layers from models being merged.Now, when I try to load the model, the error is:
Any help would be appreciated.
Gerti
Please make sure that the boxes below are checked before you submit your issue. If your issue is an implementation question, please ask your question on StackOverflow or join the Keras Slack channel and ask there instead of filing a GitHub issue.
Thank you!
[x ] Check that you are up-to-date with the master branch of Keras. You can update with: pip install git+git://github.com/fchollet/keras.git --upgrade --no-deps
[ ] If running on TensorFlow, check that you are up-to-date with the latest version. The installation instructions can be found here.
[ x] If running on Theano, check that you are up-to-date with the master branch of Theano. You can update with: pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps
[x ] Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).