title: tensorflow-gpu ValueError: Unknown layer: Functional
body: <p>I'm trying to load a model from a .h5 file(trained by mobilenetv2).</p>
  <pre><code>from tensorflow.keras import models
  class Classifier(object):
  
      def __init__(self, model_path):
          self.model = models.load_model(model_path)
  </code></pre>
  <p>Code of my model:</p>
  <pre><code>model_pre = keras.applications.MobileNetV2(
      input_shape=(224, 224, 3),
      include_top=False,
  )
  
  model_pre.trainable = False
  
  last_output = model_pre.output
  
  x = Flatten()(last_output)
  x = Dense(3, activation='softmax')(x) 
  model = tf.keras.Model(model_pre.input, x)
  
  model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
  
  model.summary()
  </code></pre>
  <p>tensorflow-gpu == 2.2 (with 2.3 same problem)
  python == 3.8.3</p>
  <p>after loading i get this problem</p>
  <pre><code>2020-10-12 21:37:39.500606: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
  Traceback (most recent call last):
    File &quot;C:/Users/manos/projects/gesture_recognition/app.py&quot;, line 28, in &lt;module&gt;
      classifier = Classifier(CLASSIFIER_MODEL_PATH)
    File &quot;C:\Users\manos\projects\gesture_recognition\classifier\gesture_classifier.py&quot;, line 9, in __init__
      self.model = models.load_model(model_path)
    File &quot;C:\Users\manos\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\keras\saving\save.py&quot;, line 184, in load_model
      return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
    File &quot;C:\Users\manos\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\keras\saving\hdf5_format.py&quot;, line 177, in load_model_from_hdf5
      model = model_config_lib.model_from_config(model_config,
    File &quot;C:\Users\manos\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\keras\saving\model_config.py&quot;, line 55, in model_from_config
      return deserialize(config, custom_objects=custom_objects)
    File &quot;C:\Users\manos\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\keras\layers\serialization.py&quot;, line 105, in deserialize
      return deserialize_keras_object(
    File &quot;C:\Users\manos\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\keras\utils\generic_utils.py&quot;, line 361, in deserialize_keras_object
      (cls, cls_config) = class_and_config_for_serialized_keras_object(
    File &quot;C:\Users\manos\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\keras\utils\generic_utils.py&quot;, line 321, in class_and_config_for_serialized_keras_object
      raise ValueError('Unknown ' + printable_module_name + ': ' + class_name)
  ValueError: Unknown layer: Functional
  </code></pre>
  <p>Everywhere I looked at solutions to this problem they wrote about upgrading or downgrading version of tensorflow-gpu, but not one option didn't help me</p>