Error: Importing Keras networks with more than 1 input or output layer is not yet supported.
4 次查看(过去 30 天)
显示 更早的评论
Hello,
I am using matlab 2019b.
I was going to import a pretrained Keras-tensorflow network in matlab, so I downloaded the latest version of "Deep Learning Toolbox Importer for TensorFlow-Keras Models" (available here: https://www.mathworks.com/matlabcentral/fileexchange/64649-deep-learning-toolbox-importer-for-tensorflow-keras-models).
I used the following command:
modelfile = 's2_038_model.json';
weights = 's2_038_lr_1e-04.h5';
net = importKerasNetwork(modelfile,'WeightFile',weights,'OutputLayerType','regression')
However I got this error: "Importing Keras networks with more than 1 input or output layer is not yet supported."
I notice that the latest version of this tool box already allows to import multiple inputs/outputs network, but how does this error happen?
Anyone has the same problem as mine?
Wish online friends could help me with some solutions, thanks in advance!
回答(1 个)
Sivylla Paraskevopoulou
2021-2-12
编辑:Sivylla Paraskevopoulou
2021-2-12
Since R2020a, you can import a Keras network with multiple inputs and multiple outputs. Try downloading a R2020a version or later of the support package. Use importKerasNetwork if the network includes input size information for the inputs and loss information for the outputs. Otherwise, use importKerasLayers. The importKerasLayers function inserts placeholder layers for the inputs and outputs. After importing, you can find and replace the placeholder layers by using findPlaceholderLayers and replaceLayer respectively.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Manage Products 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!