title: Keras InceptionV3 TypeError: unhashable type: 'Dimension'
body: <p>I am trying to implement a model which will take grayscale images as input and return a numeric value as output. I am using InceptionV3 (training from scratch) as feature extractor and then using some dense layers for the regression for the last stages.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>from keras.applications.inception_v3 import InceptionV3
  from keras.layers import Input, GlobalAveragePooling2D, Dense, Dropout, Flatten, BatchNormalization
  from keras.models import Model
  from keras.metrics import mean_absolute_error
  from keras.utils import plot_model
  
  inputs = Input(shape=(256, 256, 1))
  x = BatchNormalization()(inputs)
  x = InceptionV3(include_top = False, weights = None, input_shape=inputs.shape[1:])(x)
  x = BatchNormalization()(x)
  x = GlobalAveragePooling2D()(x)
  x = Dense(1000, activation = 'relu' )(x)
  x = Dense(1000, activation = 'relu' )(x)
  outputs = Dense(1, activation = 'linear' )(x)
  model = Model(inputs=inputs, outputs=outputs)
  
  model.compile(optimizer = 'adam', loss = 'mse', metrics = [mae])
  
  model.summary()
  </code></pre>
  
  <p>Now I am getting this error when I run the code:</p>
  
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-36-50041eb640cc&gt; in &lt;module&gt;()
        7 inputs = Input(shape=(256, 256, 1))
        8 x = BatchNormalization()(inputs)
  ----&gt; 9 x = InceptionV3(include_top = False, weights = None, input_shape=inputs.shape[1:])(x)
       10 x = BatchNormalization()(x)
       11 x = GlobalAveragePooling2D()(x)
  
  3 frames
  /usr/local/lib/python3.6/dist-packages/keras_applications/imagenet_utils.py in _obtain_input_shape(input_shape, default_size, min_size, data_format, require_flatten, weights)
      273             default_shape = (input_shape[0], default_size, default_size)
      274         else:
  --&gt; 275             if input_shape[-1] not in {1, 3}:
      276                 warnings.warn(
      277                     'This model usually expects 1 or 3 input channels. '
  
  TypeError: unhashable type: 'Dimension'
  </code></pre>
  
  <p>I don't understand what is causing the error because it was absolutely fine when I was using sequential model. But it is not working for this functional model.</p>