title: Tensor object has no attribute keras_shape
body: <p>While building a model using:</p>
  
  <pre><code>model = Model(inputs=[input_text], outputs=pred)
  </code></pre>
  
  <p>getting an error:</p>
  
  <blockquote>
    <p>AttributeError: 'Tensor' object has no attribute '_keras_shape'</p>
  </blockquote>
  
  <p>The complete notebook that I tried can be found here...
  <a href="https://github.com/shantanuo/pandas_examples/blob/master/tensorflow/tf_learn.ipynb" rel="noreferrer">https://github.com/shantanuo/pandas_examples/blob/master/tensorflow/tf_learn.ipynb</a></p>
  
  <p>And the same code in plain text here...
  <a href="https://gist.github.com/shantanuo/4e35baba144ee658e4dd4d1f87e19f3a" rel="noreferrer">https://gist.github.com/shantanuo/4e35baba144ee658e4dd4d1f87e19f3a</a></p>
  
  <p>I will like to know why am I getting an error even if I am using the exact same code as shown in this blog:</p>
  
  <p><a href="https://towardsdatascience.com/transfer-learning-using-elmo-embedding-c4a7e415103c" rel="noreferrer">https://towardsdatascience.com/transfer-learning-using-elmo-embedding-c4a7e415103c</a></p>
  
  <p>The expected output - something like this:</p>
  
  <blockquote>
    <p>The model summary is:
    _________________________________________________________________ Layer (type)                 Output Shape              Param #<br>
    ================================================================= input_2 (InputLayer)         (None, 1)                 0<br>
    _________________________________________________________________ lambda_2 (Lambda)            (None, 1024)              0<br>
    _________________________________________________________________ dense_3 (Dense)              (None, 256)               262400<br>
    _________________________________________________________________ dense_4 (Dense)              (None, 1)                 257</p>
  </blockquote>
  
  <p>I tried to upgrade tensorflow and keras but getting the same error:</p>
  
  <pre><code>!pip install --upgrade tensorflow
  </code></pre>