Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error] Can not convert SaveModel to TFLite #47

Open
LaiThePhong opened this issue Dec 27, 2024 · 1 comment
Open

[Error] Can not convert SaveModel to TFLite #47

LaiThePhong opened this issue Dec 27, 2024 · 1 comment

Comments

@LaiThePhong
Copy link

LaiThePhong commented Dec 27, 2024

Hello,
I copied all code from basic_training_notebook.ipynb and run on my collab 👈 I already shared it public, you can check the output in the last cells.

The steps like Generated positive data (the wakeword), Preparing data, Augmenting data, Training model, and Evaluation model are processed successfully. The trained model was saved as .h5 file as name: "last_weights.h5".
Then, to create TFlite file, I changed the flags: --train 0, --test_tf_nonstreaming 1 , the code executed 2 steps status below:

  • Step 1: convert .h5 model to SaveModel: ✅ Success. (This time, I can see the .pb model in pathtrained_models/wakeword/non_stream/fingerprint.pb)
  • Step 2: convert SaveModel to tflite: ❌ Error with display message: RuntimeError: failed to update filter tensor FULLY_CONNECTED node #21Node number 28 (TfLiteXNNPackDelegate) failed to prepare.

Same issue when I changed --train 0, --test_tflite_streaming 1: RuntimeError: failed to update filter tensor FULLY_CONNECTED node #48Node number 58 (TfLiteXNNPackDelegate) failed to prepare.

I am searching some solutions on the internet, but if you guys are familiar with this issue, please let me know to try it.
Thank you, so much.

image
@kahrendt
Copy link
Owner

Sorry, I don't think this one was fixed with #48, sorry for referencing this!

It doesn't look like you let the model train fully. It seems like it went through one training batch, but it didn't finish testing on the validation set. Its possible the weights weren't properly saved in that situation. Try letting the model train for more mini-batches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants