Using a python trained neural network

S
Sania · Dec 5, 2024 · 2.5K views
Question
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 PhD Expert
Answered Sep 17, 2026
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")
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!