title: TF2.2: Loading a Saved Model from tensorflow_hub failed with `AttributeError: '_UserObject' object has no attribute 'summary'`
body: <p><strong>System info:</strong>
  Python: 3.6.9
  Tensorflow: 2.2.0 CPU package from pip</p>
  
  <p><strong>The issue:</strong></p>
  
  <p>I got <a href="https://tfhub.dev/google/imagenet/resnet_v2_50/classification/4?tf-hub-format=compressed" rel="noreferrer">https://tfhub.dev/google/imagenet/resnet_v2_50/classification/4?tf-hub-format=compressed</a> from tf-hub and then uncompressed in a new directory.</p>
  
  <pre><code>wget https://storage.googleapis.com/tfhub-modules/google/imagenet/resnet_v2_50/feature_vector/4.tar.gz
  mkdir test_pb
  mv 4.tar.gz test_pb
  cd test_pb
  tar -xvf 4.tar.gz
  rm 4.tar.gz
  cd ..
  ./test.py
  </code></pre>
  
  <p><a href="https://storage.googleapis.com/tfhub-modules/google/imagenet/resnet_v2_50/feature_vector/4.tar.gz" rel="noreferrer">https://storage.googleapis.com/tfhub-modules/google/imagenet/resnet_v2_50/feature_vector/4.tar.gz</a> is the feature vector pre-trained model from <a href="https://tfhub.dev/google/imagenet/resnet_v2_50/feature_vector/4" rel="noreferrer">https://tfhub.dev/google/imagenet/resnet_v2_50/feature_vector/4</a> in tf-hub.</p>
  
  <p><code>test.py</code> is the Python script, and this following is the standalone code:</p>
  
  <pre><code>#!/usr/bin/env python3
  from __future__ import absolute_import, division, print_function, unicode_literals
  
  import os
  import tensorflow as tf
  
  print(tf.__version__)
  
  resnet50v2_save_path = os.path.join('.', "./test_pb/")
  
  loaded1 = tf.keras.models.load_model(resnet50v2_save_path)
  print("Load done")
  
  print("Signatures: ", loaded1.signatures)
  
  print("Type: ", type(loaded1))
  
  print(loaded1.summary())
  </code></pre>
  
  <p>that give this output:</p>
  
  <pre><code>2.2.0
  2020-06-12 20:29:07.677555: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 1995455000 Hz
  2020-06-12 20:29:07.678219: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x59eb130 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
  2020-06-12 20:29:07.678241: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
  Load done
  Signatures:  _SignatureMap({})
  Type:  &lt;class 'tensorflow.python.saved_model.load.Loader._recreate_base_user_object.&lt;locals&gt;._UserObject'&gt;
  Traceback (most recent call last):
    File "./test.py", line 18, in &lt;module&gt;
      print(loaded1.summary())
  AttributeError: '_UserObject' object has no attribute 'summary'
  </code></pre>
  
  <p>that is the mentioned error.</p>
  
  <p>Why?</p>
  
  <p>Thx</p>