Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

# If you are using Tensorflow Hub model and then saved it in .

h5 format then you


need to use the following special parameter custom_objects during loading the model
with load_model

loaded_model = tf.keras.models.load_model("mymodel.h5", custom_objects=


{'KerasLayer': hub.KerasLayer})

---------------------------------------------

or try using saved_model as follows:

Save: tf.saved_model.save(model, path_to_dir)


Load: model = tf.saved_model.load(path_to_dir)

You might also like