importing a ResNet model of python code in matlab?
조회 수: 1 (최근 30일)
이전 댓글 표시
I would like to load a deep network from the attached python code file and use it in the trainNetwork function in matlab.
Attached file: ResNet_simple_model.py, which contains the deep neural network model. (import tensorflow, numpy, sys, etc.)
How can I load and run this in matlab, load it as lgraph or layers, and train it with the trainNetwork(training_data, layers, options) function?
Waiting for help from experts.
댓글 수: 2
Constantino Carlos Reyes-Aldasoro
2023년 8월 17일
Have you tried using the native ResNet CNNs (https://uk.mathworks.com/help/deeplearning/ref/resnet50.html)?
채택된 답변
Angelo Yeo
2023년 8월 18일
1) Like @Constantino Carlos Reyes-Aldasoro said, you may apply to use the shipped ResNet for your research.
However, your Python model shows that your model is different from known ResNet models but rarther customized ones.
2) If you are using MATLAB R2021a or above, consider using importTensorFlowNetwork function. In order to import TF Network, you can save the model in "pb" format. How to save a TF Network into "pb" can be found in the link below.
https://www.tensorflow.org/guide/saved_model
댓글 수: 3
Angelo Yeo
2023년 8월 18일
Can you describe your workflow? Why do you want to run "py" files via MATLAB?
In my imagination, I assumed that you might want to import trained network from Python's end. If you want to cowork with Python users you can also export the trained model with exportNetworkToTensorFlow.
추가 답변 (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!