How to save a trained deep learning model in .mat format in Python and load it in MATLAB

17 次查看(过去 30 天)
simParameters.DLNetworkFilename = 'TrainedNetwork.mat'
For example I want to train a deep learning model in python and save it with the name 'TrainedNetwork.mat'.
And the load this network in MATLAB

回答(1 个)

Raj
Raj 2024-4-2
As per my understanding, a better alternative to saving a deep learning model in .mat format in Python and loading it in MATLAB will be importing the model to MATLAB itself and then saving it in .mat format.
MATLAB provides the 'importNetworkFromTensorFlow' function to directly import TensorFlow network as MATLAB network.
Saving the model in .mat format in Python may not be an efficient format for large models or complex architecture. Using the 'scipy.io.savemat' function under the SciPy pyton library, you can save the array objects in the given dictionary to a MATLAB- style .mat file, but that will not be a recommended approach in this scenario
Additionally you can refer to the following documentation link on the 'importNetworkFromTensorFlow' function for better understanding-
I hope this solves your query!

类别

Help CenterFile Exchange 中查找有关 Call Python from MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by