0

I am new to machine learning technology and I have a simple question. I have trained a network on the fashion MNIST and saved it, and then I would like to import the saved model for further processing instead of training the network each time I use the code. Can anyone help? I have used the import function, but it always gives me an error

model.save("model_1.h5py")  # save the model
model.import("model_2.h5py") # when I try to import the #model alwys gives me a valid synthax
M.Tag
  • 1
  • If you are using tensorflow then try using `model = tf.saved_model.load(path)` or `model = tf.keras.models.load_model(path)` – Kaushik Roy Oct 02 '19 at 09:56
  • Thanks for your response but unfortunately it didn't work, however, it worked after using this line model = keras.models.load_model('fashion_model_fine_tuning.h5', custom_objects={'tf': tf}) – M.Tag Oct 02 '19 at 10:27
  • Take a look this answer. https://stackoverflow.com/questions/28170623/how-to-read-hdf5-files-in-python – George Yu Oct 03 '19 at 20:25

0 Answers0