Import Keras network From Python to Matlab
古いコメントを表示
Hi,
I want to import a trained TensorFlow Keras model from Python to Matlab. I already have a '.h5' file with this model, but I keep getting the error 'Keras network with multiple inputs or multiple outputs is not supported when one of the network inputs is sequential' when I use the function ImportKerasNetwork or ImportKerasLayers.
Is there any way in solving this? Or is there any other way to import this model into Matlab?
回答 (1 件)
Sivylla Paraskevopoulou
2022 年 11 月 15 日
0 投票
You can try to import your TensorFlow model by using the importTensorFlowNetwork function, which is a newer function than importKerasNetwork and supports more options.
You have to save your .h5 model in the SavedModel format to import it by using the importTensorFlowNetwork function.
6 件のコメント
Tristan Milleville
2022 年 11 月 15 日
Sivylla Paraskevopoulou
2022 年 11 月 15 日
The importTensorFlowNetwork function can import TensorFlow networks created with the sequential or functional API, but not models with subclassing.
Tristan Milleville
2022 年 11 月 16 日
Sivylla Paraskevopoulou
2022 年 11 月 16 日
The function supports importing LSTM networks. This does not necessarily mean that it supports all the layers in your TensorFlow model for conversion to MATLAB layers. To learn more, read these sections on Autogenerated Custom Layers and Placeholder Layers.
Tristan Milleville
2022 年 11 月 18 日
Sivylla Paraskevopoulou
2022 年 11 月 18 日
編集済み: Sivylla Paraskevopoulou
2022 年 11 月 18 日
You are welcome! For this workflow, you might find this GitHub example helpful: Image Classification in MATLAB Using TensorFlow.
カテゴリ
ヘルプ センター および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!