title: Tensorflow, CNN + LSTM: Easier way to reuse CNN?
body: <p>I am using <code>TensorFlow 1.15</code> to train an <strong>LSTM</strong> on <strong>2D</strong> images sequentially in time.  So effectively I have the following <code>[Input (3x) -&gt; CNN -&gt; LSTM -&gt; Output]</code>.  Since I am training on multiple images, I want to apply the entire <strong><code>CNN</code></strong> subgraph to each image (<em>I would like to reuse all the weights since the current frame is image-wise no different from 1-X frame(s) ago</em>), then feed all the outputs to the LSTM.</p>
  
  <p>My current code I am using 3 frames of data so I use a loop to create 3 placeholders (<code>Input0/Input1/Input2</code>) and 3 CNNs (sharing the weights by calling tf.Variable outside the loop, although tf.get_variable might simplify that a bit).</p>
  
  <p>Is there a simpler way to express in TensorFlow I have a subgraph I want to call '<code>CNN</code>' and use it with X placeholders, then feed all those outputs to something like LSTM?</p>
  
  <p><a href="https://i.stack.imgur.com/JN8CK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JN8CK.png" alt="Tensorboard"></a></p>