-
Notifications
You must be signed in to change notification settings - Fork 26
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
Problem loading Google's Teachable Machine models #4
Comments
If I may confirm the first issue - is the problem the binary size? Or manually enabling GTM? For the second issue, I believe the authors responsible for tensorflow iOS are investigating the problem, which can be found here. If you absolutely need to use an emulator, you can consider building the select ops framework yourself. Instructions can be provided here |
@Caldarie thanks for your tips! 😁 For the first issue, I was having problems loading the GTM model but already fixed it. Works on Android device but I did not yet tested on iOS! To use an emulator, I have been having some problems configuring correctly but I will guide using the documentation link you suggested! Thanks again 🤩 |
@cmalbuquerque No problems at all. I’m glad it worked out in the end. If it’s not too much trouble, would you mind sharing how you fixed he problem? It would really help others who also had a similar problem as you. |
Basically, I follow these steps first (for Android scenario): 1. Add permissions to Android Manifest
2. Add aaptOptions to
3. Enable select-ops in
After that, I loaded the model using the following definitions in the initState() :
And to get the result I specified 'rawAudio' has inputType because of GTM model's input type, and in order to make a quick test I defined a recordingLength. After completed the recording length, the classification is printed on terminal.
I only tested with an Android device, but I will follow these steps to prepare iOS device. |
@cmalbuquerque many thanks for the detailed explanation! |
Hey guys I wanted to know if its is working on iOs now ?? |
@Caldarie not working on Android for me .. |
@Tanelo - can you provide details to reproduce this problem? It’s difficult to assist you if you don’t give more information Also, have you tried running the example as well to check where you went wrong? You can git clone this project and run the example on your device. To do that, run the following commands below on terminal:
|
@Caldarie Thanks for your help, The beginning is Build fingerprint: 'google/sdk_gphone_x86_arm/generic_x86_arm:11/RSR1.201013.001/6903271:userdebug/dev-keys' |
When running the decodwave on android (as well on the ios simulator) it's working fine ! Debug session : |
@Tanelo you cannot use 'decodedWav' as inputType if you are using a GTM model! Try to change the inputType to 'rawAudio' in your audio recognition method |
@Tanelo many thanks for the error logs. It looks like an error with the tensorflow library, though I cant seem to glean any more information than that. Can you provide more logs from the beginning? Also, using @cmalbuquerque suggestion, can you check that you are using these parameters: final String model = 'assets/google_teach_machine_model.tflite';
final String label = 'assets/google_teach_machine_label.txt';
final String inputType = 'rawAudio';
final int sampleRate = 44100;
final int recordingLength = 44032;
final int bufferSize = 22016;
final int numOfInferences = 1; |
More of the debug mode : ` Build fingerprint: 'google/sdk_gphone_x86_arm/generic_x86_arm:11/RSR1.201013.001/6903271:userdebug/dev-keys' #145 pc 0036fb02 /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.16375758241455872412)+370) (BuildId: 8191579dfafff37a5cbca70f9a73020f) Let me explain you what's happening, when running the app, the debug session is starting, everything is okay, then, at the moment when the app is loading and opening on the android emulator, it's freezing and closing directly. |
Hi @Tanelo sorry for the late reply. I’ve been a bit busy with another project. If it’s not too much to ask, do you have a deadline? I may need time to investigate this issue |
@Caldarie I have no deadline, or like a week or two. Thanks ! |
I would like to know if these known issues will be resolved in the meantime?
The text was updated successfully, but these errors were encountered: