Using a python trained neural network

Illustration
Sania - 2024-12-05T13:00:09+00:00
Question: Using a python trained neural network

Can you please tell me how I can save a neural network after training,in Jupiter notebook and retrieve it in MATLAB for testing on the TEST dataset. Should I store it without .h5 or with h5 extension? A new folder "MyModel" is created, when I run generator.save("MyModel") and there is a file inside it with name "saved_model.pb"? How it is loaded and tested in MATLAB 2019a version?

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

I would recommend saving the model in the TensorFlow saved model format and then import it via the TensorFlow converter using the function importTensorFlowNetwork.
 
To save a model in the TensorFlow saved model format use the following python code:
model.save("MyModel")


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!