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

16 ビュー (過去 30 日間)
ANUSAYA SWAIN
ANUSAYA SWAIN 2024 年 3 月 27 日
回答済み: Raj 2024 年 4 月 2 日
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 Center および File ExchangeCall Python from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by