New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layer with multiple outputs #3061
Comments
@rilut I'm not talking about implementing a model with multiple outputs. I'm talking about implementing a custom layer with multiple outputs. Something along the lines of:
Unfortunately when I do the above, it gives me an error saying tuple object does not have attribute _keras_shape. What is the correct way to do this? |
I am having the same issue. Did you find a solution? |
An upvote for this issue! |
Another up vote. My guess is that this option is not available. I haven't seen any of the built-in Keras layers return more than one output. My hacky work-around is to merge the outputs into one tensor, and then later split it to multiple tensor. It could be more more elegant, though, if Keras supports multiple outputs. |
I seem to have a layer with multiple outputs working.
|
@rjrowekamp Thanks! I gave it another try and managed to get it working as well, but with slightly different approach.
This is mostly working. But it broke the Tensorboard callback (which seems to assume that all layers return one tensor). I disabled the histogram summary in that callback and that allowed me to side-step the bug for now. |
@waleedka
My callback still worked but the graph would not display, everything else seemed to be fine though. |
@vqdang The TensorBoard callback was trying to create a histogram of the outputs of each layer, and I believe it assumes that all layers generate one output (or similarly shaped outputs). So it was complaining that the shapes and data types of the outputs didn't match. I disabled the histogram feature by setting its frequency to zero as such:
|
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. |
It seems that the |
@agamemnonc at some point |
Same problem. Is there any solutions? |
How do I implement a custom layer which returns multiple outputs instead of a single one?
Please make sure that the boxes below are checked before you submit your issue. Thank you!
pip install git+git://github.com/fchollet/keras.git --upgrade --no-deps
pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps
The text was updated successfully, but these errors were encountered: