0
model = tf.keras.models.load_model(model_path)

is giving me error as,

ValueError('Unknown ' + printable_module_name + ': ' + class_name) ValueError: Unknown layer: Functional

I tried setting path model_path = "{}{}".format(Path().absolute(),"/model_new.h5") using tensorflow -2.2.0 and keras -2.4.3

B Douchet
  • 970
  • 1
  • 9
  • 20
Athira K
  • 1
  • 1
  • 2
    Does this answer your question? https://stackoverflow.com/questions/63068639/valueerror-unknown-layer-functional – ranka47 Dec 15 '20 at 15:05

1 Answers1

0

ValueError: Unknown layer: Functional

You are getting above error, because you trained the model using Tensorflow 2.2.0 and then tried to accessing the saved model( i.e model_new.h5) using different version of Tensorflow.

To fix above problem you can try to load the model using Tensorflow 2.2.0. (Or)

If you don't want to downgrade tensorflow version then you can try to retrained model using the same version.