<p dir="auto">Hi, Heros<br>
i have a small program that using the "dot merge".<br>
it goes smoothly in training phase,but when i want to do some test with the model, the parameters cannot be loaded into, and it reported an error:<br>
"AssertionError: Provided weight array does not match layer weights (12 layer params vs. 3 provided weights)"<br>
Related codes are as follows (irrelevant parts are removed. ):</p>
<p dir="auto">a1=Sequential()<br>
a1.add(Embedding(100,input_length=maxlen))<br>
a1.add(LSTM(100,return_sequence=True))</p>
<p dir="auto">a2=Sequential()<br>
a2.add(Embedding(100,input_length=maxlen))<br>
a2.add(LSTM(100,return_sequence=True, go_backwards=True))</p>
<h1 dir="auto">output: (n_sample, maxlen, dim)</h1>
<p dir="auto">a = Sequential()<br>
a.add(Merge([a1,a2], mode='concat'))</p>
<p dir="auto">b1=Sequential()<br>
b1.add(Embedding(100,input_length=maxlen))<br>
b1.add(LSTM(100,return_sequence=True))</p>
<p dir="auto">b2=Sequential()<br>
b2.add(Embedding(100,input_length=maxlen))<br>
b2.add(LSTM(100,return_sequence=True, go_backwards=True))</p>
<h1 dir="auto">output: (n_sample, dim)</h1>
<p dir="auto">b = Sequential()<br>
b.add(Merge([b1,b2], mode='concat'))<br>
b.add(TimeDistributedMerge(mode='sum'))</p>
<h1 dir="auto">output: (n_sample, maxlen ,dim)</h1>
<p dir="auto">b_rep = Sequential()<br>
b_rep.add(Merge([b1,b2], mode='concat'))<br>
b_rep.add(TimeDistributedMerge(mode='sum'))<br>
b_rep.add(RepeatVector(maxlen))</p>
<h1 dir="auto">output: (n_sample, maxlen)</h1>
<p dir="auto">c = Sequential()<br>
c.add(Merge([a,b_rep], mode='concat'))<br>
c.add(TimeDistributedMerge(mode='sum'))<br>
c.add(Dense(maxlen))</p>
<h1 dir="auto">hope to output : (n_sample, dim)</h1>
<p dir="auto">res=Sequential()<br>
res.add(Merge([b_rep,c], mode='dot', dot_axes=([1],[1]))) #also tried other merge mode, such as: res.add(Merge([b,c], mode='concat')) but it also report the error. so it seems that not the problem only with the DOT mode, but the Merge layer.</p>
<h1 dir="auto">the following the is debug code</h1>
<p dir="auto">w = res.get_weights()<br>
model.set_weights(w)      #this will cause the error, also tried using save/load_weights, but do not solve the problem</p>
<p dir="auto">i have tried 0.2.0, 0.3.0, 0.3.1 versions, but none of them can solve this problem.<br>
Wish anyone can help!</p>
<p dir="auto">Building an autoencoder inside a Jupyter Notebook. I am having issues with TensorBoard each time I redefine layers of a model.</p>
<ul class="contains-task-list">
<li class="task-list-item">
<p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Check that you are up-to-date with the master branch of Keras. You can update with:<br>
<code class="notranslate">pip install git+git://github.com/keras-team/keras.git --upgrade --no-deps</code></p>
</li>
<li class="task-list-item">
<p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Check that your version of TensorFlow is up-to-date. 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=""> 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">Here a recap of the code involved. I did not define any model before the one bellow in my notebook.</p>
<p dir="auto">Cell0: Imports</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="%matplotlib inline
import h5py
import os
from keras import backend as K
from keras.layers import Input, Dense, Conv2D, Conv2DTranspose, Dropout, Activation, BatchNormalization, Reshape
from keras.models import Model
import tensorflow as tf
from keras.callbacks import TensorBoard, Callback

import matplotlib.pyplot as plt
import numpy as np"><pre class="notranslate"><code class="notranslate">%matplotlib inline
import h5py
import os
from keras import backend as K
from keras.layers import Input, Dense, Conv2D, Conv2DTranspose, Dropout, Activation, BatchNormalization, Reshape
from keras.models import Model
import tensorflow as tf
from keras.callbacks import TensorBoard, Callback

import matplotlib.pyplot as plt
import numpy as np
</code></pre></div>
<p dir="auto">I am working with my own database (shape (1412, 128, 128, 3))<br>
Cell1</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def tbCallBack(foldername):
    return TensorBoard(log_dir='./logs/'+foldername, histogram_freq=20, batch_size=1, 
                                 write_graph=False, write_grads=True, write_images=False, 
                                 update_freq='epoch')"><pre class="notranslate"><code class="notranslate">def tbCallBack(foldername):
    return TensorBoard(log_dir='./logs/'+foldername, histogram_freq=20, batch_size=1, 
                                 write_graph=False, write_grads=True, write_images=False, 
                                 update_freq='epoch')
</code></pre></div>
<p dir="auto">Cell2: Define model</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="input_img = Input(shape=(128, 128, 3))
n_conv_parameter = 4
latent_dim = 4

# Encoder
conv1 = Conv2D(n_conv_parameter, kernel_size=3, strides=16, activation='relu', 
               padding='same')(input_img)
#Middle layer
dense1 = Dense(latent_dim)(conv1)
# Decode
dense2 = Dense(n_conv_parameter)(dense1)
decoded = Conv2DTranspose(3, kernel_size=3, strides=16, activation='sigmoid', 
                          padding='same')(dense2)

autoencoder = Model(input_img, decoded)
autoencoder.compile(optimizer='adam', loss='mean_squared_error')
autoencoder.summary()"><pre class="notranslate"><code class="notranslate">input_img = Input(shape=(128, 128, 3))
n_conv_parameter = 4
latent_dim = 4

# Encoder
conv1 = Conv2D(n_conv_parameter, kernel_size=3, strides=16, activation='relu', 
               padding='same')(input_img)
#Middle layer
dense1 = Dense(latent_dim)(conv1)
# Decode
dense2 = Dense(n_conv_parameter)(dense1)
decoded = Conv2DTranspose(3, kernel_size=3, strides=16, activation='sigmoid', 
                          padding='same')(dense2)

autoencoder = Model(input_img, decoded)
autoencoder.compile(optimizer='adam', loss='mean_squared_error')
autoencoder.summary()
</code></pre></div>
<p dir="auto">Cell3: Training</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="autoencoder.fit(database, database,
                epochs=2,
                batch_size=64,
                shuffle=True,
                validation_split=0.1,
                callbacks=[tbCallBack('autoencoder')]
                )"><pre class="notranslate"><code class="notranslate">autoencoder.fit(database, database,
                epochs=2,
                batch_size=64,
                shuffle=True,
                validation_split=0.1,
                callbacks=[tbCallBack('autoencoder')]
                )
</code></pre></div>
<p dir="auto">How to reproduce:<br>
excute cells in this order:<br>
Cell 1 + Cell 2 + Cell3 + Cell2  + Cell3</p>
<p dir="auto">No issue, if I run my code once (Cell1 + Cell2 +Cell3). But if I run another time the Cell2  after Call3 (I redefine my model), I will be able to train and test the model, but it crashes if I use a <strong>CallBack</strong> for <strong>TensorBoard</strong> at the end of the first epoch.</p>
<p dir="auto">Error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Train on 1270 samples, validate on 142 samples
Epoch 1/2
1270/1270 [==============================] - 1s 690us/step - loss: 0.1500 - val_loss: 0.1473

---------------------------------------------------------------------------
InvalidArgumentError                      Traceback (most recent call last)
~/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
   1334     try:
-&gt; 1335       return fn(*args)
   1336     except errors.OpError as e:

~/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run_fn(feed_dict, fetch_list, target_list, options, run_metadata)
   1319       return self._call_tf_sessionrun(
-&gt; 1320           options, feed_dict, fetch_list, target_list, run_metadata)
   1321 

~/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _call_tf_sessionrun(self, options, feed_dict, fetch_list, target_list, run_metadata)
   1407         self._session, options, feed_dict, fetch_list, target_list,
-&gt; 1408         run_metadata)
   1409 

InvalidArgumentError: You must feed a value for placeholder tensor 'input_1' with dtype float and shape [?,128,128,3]
	 [[{{node input_1}}]]

During handling of the above exception, another exception occurred:

InvalidArgumentError                      Traceback (most recent call last)
&lt;ipython-input-12-8f41c0e29511&gt; in &lt;module&gt;
      4                 shuffle=True,
      5                 validation_split=0.1,
----&gt; 6                 callbacks=[tbCallBack('autoencoder')]
      7                 )

~/.local/lib/python3.5/site-packages/keras/engine/training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)
   1037                                         initial_epoch=initial_epoch,
   1038                                         steps_per_epoch=steps_per_epoch,
-&gt; 1039                                         validation_steps=validation_steps)
   1040 
   1041     def evaluate(self, x=None, y=None,

~/.local/lib/python3.5/site-packages/keras/engine/training_arrays.py in fit_loop(model, f, ins, out_labels, batch_size, epochs, verbose, callbacks, val_f, val_ins, shuffle, callback_metrics, initial_epoch, steps_per_epoch, validation_steps)
    215                         for l, o in zip(out_labels, val_outs):
    216                             epoch_logs['val_' + l] = o
--&gt; 217         callbacks.on_epoch_end(epoch, epoch_logs)
    218         if callback_model.stop_training:
    219             break

~/.local/lib/python3.5/site-packages/keras/callbacks.py in on_epoch_end(self, epoch, logs)
     77         logs = logs or {}
     78         for callback in self.callbacks:
---&gt; 79             callback.on_epoch_end(epoch, logs)
     80 
     81     def on_batch_begin(self, batch, logs=None):

~/.local/lib/python3.5/site-packages/keras/callbacks.py in on_epoch_end(self, epoch, logs)
    939                     assert len(batch_val) == len(tensors)
    940                     feed_dict = dict(zip(tensors, batch_val))
--&gt; 941                     result = self.sess.run([self.merged], feed_dict=feed_dict)
    942                     summary_str = result[0]
    943                     self.writer.add_summary(summary_str, epoch)

~/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in run(self, fetches, feed_dict, options, run_metadata)
    928     try:
    929       result = self._run(None, fetches, feed_dict, options_ptr,
--&gt; 930                          run_metadata_ptr)
    931       if run_metadata:
    932         proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)

~/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run(self, handle, fetches, feed_dict, options, run_metadata)
   1151     if final_fetches or final_targets or (handle and feed_dict_tensor):
   1152       results = self._do_run(handle, final_targets, final_fetches,
-&gt; 1153                              feed_dict_tensor, options, run_metadata)
   1154     else:
   1155       results = []

~/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
   1327     if handle is None:
   1328       return self._do_call(_run_fn, feeds, fetches, targets, options,
-&gt; 1329                            run_metadata)
   1330     else:
   1331       return self._do_call(_prun_fn, handle, feeds, fetches)

~/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
   1347           pass
   1348       message = error_interpolation.interpolate(message, self._graph)
-&gt; 1349       raise type(e)(node_def, op, message)
   1350 
   1351   def _extend_graph(self):

InvalidArgumentError: You must feed a value for placeholder tensor 'input_1' with dtype float and shape [?,128,128,3]
	 [[node input_1 (defined at /home/phmignot/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:517) ]]

Original stack trace for 'input_1':
  File &quot;/usr/lib/python3.5/runpy.py&quot;, line 184, in _run_module_as_main
    &quot;__main__&quot;, mod_spec)
  File &quot;/usr/lib/python3.5/runpy.py&quot;, line 85, in _run_code
    exec(code, run_globals)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/ipykernel_launcher.py&quot;, line 16, in &lt;module&gt;
    app.launch_new_instance()
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/traitlets/config/application.py&quot;, line 658, in launch_instance
    app.start()
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/ipykernel/kernelapp.py&quot;, line 505, in start
    self.io_loop.start()
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tornado/platform/asyncio.py&quot;, line 132, in start
    self.asyncio_loop.run_forever()
  File &quot;/usr/lib/python3.5/asyncio/base_events.py&quot;, line 345, in run_forever
    self._run_once()
  File &quot;/usr/lib/python3.5/asyncio/base_events.py&quot;, line 1312, in _run_once
    handle._run()
  File &quot;/usr/lib/python3.5/asyncio/events.py&quot;, line 125, in _run
    self._callback(*self._args)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tornado/ioloop.py&quot;, line 758, in _run_callback
    ret = callback()
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tornado/stack_context.py&quot;, line 300, in null_wrapper
    return fn(*args, **kwargs)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py&quot;, line 1233, in inner
    self.run()
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py&quot;, line 1147, in run
    yielded = self.gen.send(value)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py&quot;, line 370, in dispatch_queue
    yield self.process_one()
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py&quot;, line 346, in wrapper
    runner = Runner(result, future, yielded)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py&quot;, line 1080, in __init__
    self.run()
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py&quot;, line 1147, in run
    yielded = self.gen.send(value)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py&quot;, line 357, in process_one
    yield gen.maybe_future(dispatch(*args))
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py&quot;, line 326, in wrapper
    yielded = next(result)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py&quot;, line 267, in dispatch_shell
    yield gen.maybe_future(handler(stream, idents, msg))
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py&quot;, line 326, in wrapper
    yielded = next(result)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py&quot;, line 534, in execute_request
    user_expressions, allow_stdin,
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py&quot;, line 326, in wrapper
    yielded = next(result)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/ipykernel/ipkernel.py&quot;, line 294, in do_execute
    res = shell.run_cell(code, store_history=store_history, silent=silent)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/ipykernel/zmqshell.py&quot;, line 536, in run_cell
    return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py&quot;, line 2819, in run_cell
    raw_cell, store_history, silent, shell_futures)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py&quot;, line 2845, in _run_cell
    return runner(coro)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/IPython/core/async_helpers.py&quot;, line 67, in _pseudo_sync_runner
    coro.send(None)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py&quot;, line 3020, in run_cell_async
    interactivity=interactivity, compiler=compiler, result=result)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py&quot;, line 3185, in run_ast_nodes
    if (yield from self.run_code(code, result)):
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py&quot;, line 3267, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File &quot;&lt;ipython-input-7-25486d4234d9&gt;&quot;, line 1, in &lt;module&gt;
    input_img = Input(shape=(128, 128, 3))
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/keras/engine/input_layer.py&quot;, line 178, in Input
    input_tensor=tensor)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/keras/legacy/interfaces.py&quot;, line 91, in wrapper
    return func(*args, **kwargs)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/keras/engine/input_layer.py&quot;, line 87, in __init__
    name=self.name)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py&quot;, line 517, in placeholder
    x = tf.placeholder(dtype, shape=shape, name=name)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py&quot;, line 2078, in placeholder
    return gen_array_ops.placeholder(dtype=dtype, shape=shape, name=name)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tensorflow/python/ops/gen_array_ops.py&quot;, line 5791, in placeholder
    &quot;Placeholder&quot;, dtype=dtype, shape=shape, name=name)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py&quot;, line 788, in _apply_op_helper
    op_def=op_def)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tensorflow/python/util/deprecation.py&quot;, line 501, in new_func
    return func(*args, **kwargs)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py&quot;, line 3300, in create_op
    op_def=op_def)
  File &quot;/home/phmignot/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py&quot;, line 1801, in __init__
    self._traceback = tf_stack.extract_stack()"><pre class="notranslate"><code class="notranslate">Train on 1270 samples, validate on 142 samples
Epoch 1/2
1270/1270 [==============================] - 1s 690us/step - loss: 0.1500 - val_loss: 0.1473

---------------------------------------------------------------------------
InvalidArgumentError                      Traceback (most recent call last)
~/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
   1334     try:
-&gt; 1335       return fn(*args)
   1336     except errors.OpError as e:

~/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run_fn(feed_dict, fetch_list, target_list, options, run_metadata)
   1319       return self._call_tf_sessionrun(
-&gt; 1320           options, feed_dict, fetch_list, target_list, run_metadata)
   1321 

~/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _call_tf_sessionrun(self, options, feed_dict, fetch_list, target_list, run_metadata)
   1407         self._session, options, feed_dict, fetch_list, target_list,
-&gt; 1408         run_metadata)
   1409 

InvalidArgumentError: You must feed a value for placeholder tensor 'input_1' with dtype float and shape [?,128,128,3]
	 [[{{node input_1}}]]

During handling of the above exception, another exception occurred:

InvalidArgumentError                      Traceback (most recent call last)
&lt;ipython-input-12-8f41c0e29511&gt; in &lt;module&gt;
      4                 shuffle=True,
      5                 validation_split=0.1,
----&gt; 6                 callbacks=[tbCallBack('autoencoder')]
      7                 )

~/.local/lib/python3.5/site-packages/keras/engine/training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)
   1037                                         initial_epoch=initial_epoch,
   1038                                         steps_per_epoch=steps_per_epoch,
-&gt; 1039                                         validation_steps=validation_steps)
   1040 
   1041     def evaluate(self, x=None, y=None,

~/.local/lib/python3.5/site-packages/keras/engine/training_arrays.py in fit_loop(model, f, ins, out_labels, batch_size, epochs, verbose, callbacks, val_f, val_ins, shuffle, callback_metrics, initial_epoch, steps_per_epoch, validation_steps)
    215                         for l, o in zip(out_labels, val_outs):
    216                             epoch_logs['val_' + l] = o
--&gt; 217         callbacks.on_epoch_end(epoch, epoch_logs)
    218         if callback_model.stop_training:
    219             break

~/.local/lib/python3.5/site-packages/keras/callbacks.py in on_epoch_end(self, epoch, logs)
     77         logs = logs or {}
     78         for callback in self.callbacks:
---&gt; 79             callback.on_epoch_end(epoch, logs)
     80 
     81     def on_batch_begin(self, batch, logs=None):

~/.local/lib/python3.5/site-packages/keras/callbacks.py in on_epoch_end(self, epoch, logs)
    939                     assert len(batch_val) == len(tensors)
    940                     feed_dict = dict(zip(tensors, batch_val))
--&gt; 941                     result = self.sess.run([self.merged], feed_dict=feed_dict)
    942                     summary_str = result[0]
    943                     self.writer.add_summary(summary_str, epoch)

~/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in run(self, fetches, feed_dict, options, run_metadata)
    928     try:
    929       result = self._run(None, fetches, feed_dict, options_ptr,
--&gt; 930                          run_metadata_ptr)
    931       if run_metadata:
    932         proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)

~/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run(self, handle, fetches, feed_dict, options, run_metadata)
   1151     if final_fetches or final_targets or (handle and feed_dict_tensor):
   1152       results = self._do_run(handle, final_targets, final_fetches,
-&gt; 1153                              feed_dict_tensor, options, run_metadata)
   1154     else:
   1155       results = []

~/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
   1327     if handle is None:
   1328       return self._do_call(_run_fn, feeds, fetches, targets, options,
-&gt; 1329                            run_metadata)
   1330     else:
   1331       return self._do_call(_prun_fn, handle, feeds, fetches)

~/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
   1347           pass
   1348       message = error_interpolation.interpolate(message, self._graph)
-&gt; 1349       raise type(e)(node_def, op, message)
   1350 
   1351   def _extend_graph(self):

InvalidArgumentError: You must feed a value for placeholder tensor 'input_1' with dtype float and shape [?,128,128,3]
	 [[node input_1 (defined at /home/phmignot/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:517) ]]

Original stack trace for 'input_1':
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/phmignot/.local/lib/python3.5/site-packages/ipykernel_launcher.py", line 16, in &lt;module&gt;
    app.launch_new_instance()
  File "/home/phmignot/.local/lib/python3.5/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/home/phmignot/.local/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 505, in start
    self.io_loop.start()
  File "/home/phmignot/.local/lib/python3.5/site-packages/tornado/platform/asyncio.py", line 132, in start
    self.asyncio_loop.run_forever()
  File "/usr/lib/python3.5/asyncio/base_events.py", line 345, in run_forever
    self._run_once()
  File "/usr/lib/python3.5/asyncio/base_events.py", line 1312, in _run_once
    handle._run()
  File "/usr/lib/python3.5/asyncio/events.py", line 125, in _run
    self._callback(*self._args)
  File "/home/phmignot/.local/lib/python3.5/site-packages/tornado/ioloop.py", line 758, in _run_callback
    ret = callback()
  File "/home/phmignot/.local/lib/python3.5/site-packages/tornado/stack_context.py", line 300, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py", line 1233, in inner
    self.run()
  File "/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py", line 1147, in run
    yielded = self.gen.send(value)
  File "/home/phmignot/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 370, in dispatch_queue
    yield self.process_one()
  File "/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py", line 346, in wrapper
    runner = Runner(result, future, yielded)
  File "/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py", line 1080, in __init__
    self.run()
  File "/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py", line 1147, in run
    yielded = self.gen.send(value)
  File "/home/phmignot/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 357, in process_one
    yield gen.maybe_future(dispatch(*args))
  File "/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py", line 326, in wrapper
    yielded = next(result)
  File "/home/phmignot/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 267, in dispatch_shell
    yield gen.maybe_future(handler(stream, idents, msg))
  File "/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py", line 326, in wrapper
    yielded = next(result)
  File "/home/phmignot/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 534, in execute_request
    user_expressions, allow_stdin,
  File "/home/phmignot/.local/lib/python3.5/site-packages/tornado/gen.py", line 326, in wrapper
    yielded = next(result)
  File "/home/phmignot/.local/lib/python3.5/site-packages/ipykernel/ipkernel.py", line 294, in do_execute
    res = shell.run_cell(code, store_history=store_history, silent=silent)
  File "/home/phmignot/.local/lib/python3.5/site-packages/ipykernel/zmqshell.py", line 536, in run_cell
    return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
  File "/home/phmignot/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2819, in run_cell
    raw_cell, store_history, silent, shell_futures)
  File "/home/phmignot/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2845, in _run_cell
    return runner(coro)
  File "/home/phmignot/.local/lib/python3.5/site-packages/IPython/core/async_helpers.py", line 67, in _pseudo_sync_runner
    coro.send(None)
  File "/home/phmignot/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 3020, in run_cell_async
    interactivity=interactivity, compiler=compiler, result=result)
  File "/home/phmignot/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 3185, in run_ast_nodes
    if (yield from self.run_code(code, result)):
  File "/home/phmignot/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 3267, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "&lt;ipython-input-7-25486d4234d9&gt;", line 1, in &lt;module&gt;
    input_img = Input(shape=(128, 128, 3))
  File "/home/phmignot/.local/lib/python3.5/site-packages/keras/engine/input_layer.py", line 178, in Input
    input_tensor=tensor)
  File "/home/phmignot/.local/lib/python3.5/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/home/phmignot/.local/lib/python3.5/site-packages/keras/engine/input_layer.py", line 87, in __init__
    name=self.name)
  File "/home/phmignot/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 517, in placeholder
    x = tf.placeholder(dtype, shape=shape, name=name)
  File "/home/phmignot/.local/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py", line 2078, in placeholder
    return gen_array_ops.placeholder(dtype=dtype, shape=shape, name=name)
  File "/home/phmignot/.local/lib/python3.5/site-packages/tensorflow/python/ops/gen_array_ops.py", line 5791, in placeholder
    "Placeholder", dtype=dtype, shape=shape, name=name)
  File "/home/phmignot/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
    op_def=op_def)
  File "/home/phmignot/.local/lib/python3.5/site-packages/tensorflow/python/util/deprecation.py", line 501, in new_func
    return func(*args, **kwargs)
  File "/home/phmignot/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
    op_def=op_def)
  File "/home/phmignot/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1801, in __init__
    self._traceback = tf_stack.extract_stack()
</code></pre></div>
<p dir="auto">Versions:</p>
<ul dir="auto">
<li>Keras : 2.2.4</li>
<li>Tensorflow : 1.12.0</li>
<li>Jupyter : 1.0.0</li>
<li>Python : 3.5.2</li>
</ul>