フィルターのクリア

How do I create a standalone executable of a pre-trained neural network imported from Keras?

7 ビュー (過去 30 日間)
I am trying to create an executable of a pre-trained NN model, imported from Keras, based on the example here https://www.mathworks.com/help/nnet/ref/importkerasnetwork.html#mw_0934d1d0-9b5b-463c-b4a4-100ee7ca3067
I used the application compiler to create the .exe. However, when I run the the file, I get an error at the classify function call, saying dot indexing is not supported for variables of this type (see attached image). Could you please suggest possible solutions to successfully create an executable? Thanks.
  1 件のコメント
Julie Sturgeon
Julie Sturgeon 2018 年 9 月 20 日
I got the same error:
Error using importKerasNetwork (line 93)
Dot indexing is not supported for variables of this type.
Debugging the errored line of code, I got another error
K>> nnet.internal.cnn.keras.importKerasNetwork(ModelFile, varargin{:});
Dot indexing is not supported for variables of this type.
Error in nnet.internal.cnn.keras.ParsedKerasModel (line 18)
this.ClassName = KerasModelConfig.class_name;
Error in nnet.internal.cnn.keras.importKerasNetwork (line 24)
KM = nnet.internal.cnn.keras.ParsedKerasModel(ModelConfig, TrainingConfig);
And it appears that the issue is that ParsedKerasModel is receiving a string instead of a struct as expected
K>> class(KerasModelConfig)
ans =
'char'
and further tracked the problem down to the readModelAndTrainingConfigs.m file, line 27. I am trying to read in a json file, and jsondecode is returning a string from reading my file, instead of a struct as in the documentation for that function.
Attached is the value for ModelConfig that was mistakenly converted to a character. Perhaps it would be nice to know what about this config is not parsing correctly.

サインインしてコメントする。

回答 (1 件)

Sivylla Paraskevopoulou
Sivylla Paraskevopoulou 2022 年 5 月 9 日
Maybe the example Deploy Imported Network with MATLAB Compiler can help you with your workflow.

カテゴリ

Help Center および File ExchangeContainers についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by