How to save a trained deep learning model in .mat format in Python and load it in MATLAB
조회 수: 16 (최근 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
댓글 수: 0
답변 (1개)
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!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!