MaixPy-v1 icon indicating copy to clipboard operation
MaixPy-v1 copied to clipboard

Convert TFile to kmodel

Open deby13 opened this issue 4 years ago • 0 comments

trying to convert a recurrent network and received an error Fatal layer shape is not supported

To Reproduce mod=keras.models.Sequential()

mod.add(layers.LSTM(16,input_shape=(None,22050),return_sequences=True,dropout=0.2)) mod.add(layers.LSTM(32,dropout=0.2)) mod.add(layers.Dense(2,activation="softmax"))

mod.compile('adam', loss="categorical_crossentropy", metrics=["accuracy"])

mod.fit(x,y, validation_data=(x_val,y_val), epochs = 16)

mod.save("somModel2.h5")

Expected behavior convert tfile to kmodel

Actual behaviour

Screenshots uasge: ./tflite2kmodel.sh xxx.tflite Fatal: Layer SHAPE is not supported NnCase.Converter.Converters.LayerNotSupportedException: Layer SHAPE is not supported at NnCase.Converter.Converters.TfLiteToGraphConverter.ConvertOperator(Operator op) in D:\Work\Repository\nncase\src\NnCase.Converter\Converters\TfLiteToGraphConverter.cs:line 63 at System.Linq.Enumerable.SelectEnumerableIterator2.ToList() at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at NnCase.Converter.Converters.TfLiteToGraphConverter.Convert() in D:\Work\Repository\nncase\src\NnCase.Converter\Converters\TfLiteToGraphConverter.cs:line 34 at NnCase.Cli.Program.Main(String[] args) in D:\Work\Repository\nncase\src\NnCase.Cli\Program.cs:line 113 at NnCase.Cli.Program.<Main>(String[] args)

Please complete the following information

  • Board: Maixduino
  • OS: Linux on Windows(WSL)

deby13 avatar Sep 27 '21 22:09 deby13