<p dir="auto">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 <a href="http://stackoverflow.com/questions/tagged/keras" rel="nofollow">StackOverflow</a> or <a href="https://keras-slack-autojoin.herokuapp.com/" rel="nofollow">join the Keras Slack channel</a> and ask there instead of filing a GitHub issue.</p>
<p dir="auto">Thank you!</p>
<ul class="contains-task-list">
<li class="task-list-item">
<p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Check that you are up-to-date with the master branch of Keras. You can update with:<br>
pip install git+git://github.com/fchollet/keras.git --upgrade --no-deps</p>
</li>
<li class="task-list-item">
<p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> If running on TensorFlow, check that you are up-to-date with the latest version. The installation instructions can be found <a href="https://www.tensorflow.org/get_started/os_setup" rel="nofollow">here</a>.</p>
</li>
<li class="task-list-item">
<p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> If running on Theano, check that you are up-to-date with the master branch of Theano. You can update with:<br>
pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps</p>
</li>
<li class="task-list-item">
<p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> 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).</p>
</li>
</ul>
<p dir="auto">Hi,</p>
<p dir="auto">I would like to share some of the hidden layers of deep multitask network using keras. Following is my code. In the code, I would like to share 'dense3'. But I get an error that<br>
"Exception: Duplicate node identifier: dense3"</p>
<p dir="auto">How would I solve such problem in Keras?</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="graph = Graph()
graph.add_input(name='input1', input_shape=( 10000, ) ) 
graph.add_input(name='input2', input_shape=( 10000, ) ) 
graph.add_node(Dense(4096), name='dense1', input='input1')
graph.add_node(Dense(4096), name='dense2', `input='input2')`
graph.add_node(Dense(128), name='dense3', input='dense1')
graph.add_node(Dense(128), name='dense3', input='dense2')

graph.add_node(Dense(40), name='dense4', input='dense3')
graph.add_node(Dense(40), name='dense5', input='dense3')

graph.add_output(name='output', inputs=['dense4', 'dense5'], merge_mode='sum')
graph.compile(optimizer='sgd', loss={'output':'categorical_crossentropy'})"><pre class="notranslate"><code class="notranslate">graph = Graph()
graph.add_input(name='input1', input_shape=( 10000, ) ) 
graph.add_input(name='input2', input_shape=( 10000, ) ) 
graph.add_node(Dense(4096), name='dense1', input='input1')
graph.add_node(Dense(4096), name='dense2', `input='input2')`
graph.add_node(Dense(128), name='dense3', input='dense1')
graph.add_node(Dense(128), name='dense3', input='dense2')

graph.add_node(Dense(40), name='dense4', input='dense3')
graph.add_node(Dense(40), name='dense5', input='dense3')

graph.add_output(name='output', inputs=['dense4', 'dense5'], merge_mode='sum')
graph.compile(optimizer='sgd', loss={'output':'categorical_crossentropy'})
</code></pre></div>