Closed cmalbuquerque closed 3 years ago
Hi @cmalbuquerque
the error that sticks out the most is:
TensorFlow Lite Error: Regular TensorFlow ops are not supported by this interpreter. Make sure you apply/link the Flex delegate before inference.
Usually, you will get this error if you run it on an emulator, but it seems like you are using a device.
The most likely possibility is that your select ops haven’t been configured correctly. Have you force load it? Instructions here
@Caldarie yes, I forced load as mentioned on documentation:
And after specify the force load, I ran into iOS folder:
$ flutter pub get
$ pod install
$ flutter clean
To check whether it’s a bug or not, can you load your model and labels on the example project provided in this repository? Can you tell me if you receive the same error?
Yes @Caldarie, I tested using the example project and I had the same error... Also, I checked your iOS configurations for GTM models and are the same than mine. 😞
If it’s ok with you, would you be willing to share your model with me? It’s possible that google may of changed something, or the people responsible for iOS tensorflow made a breaking change.
Yes, of course! Maybe you're right and some update from them breaks something...
Here is my basic model: gtm_model.zip
Thanks! 😄
Hi @cmalbuquerque,
I was able to run your model fine (as shown on the image below).
There are few possibilities for your problem:
It's possible that your editor (vscode or xcode) has failed to detect your device and you are running the project on an emulator. To detect the device, you need to run a few steps: Instructions here
The other possibility is that your configuration may be incorrect. But i think that is least likely considering that you ran it with my example
Another possibility is that you may have forgotten to add the following in your pubsec.yaml. However, i also think this is also very unlikely.
- assets/soundclassifier.tflite
- assets/labels.txt
Thanks! Could you tell me what's your Xcode version?
I reviewed all steps of my configuration and I noticed that when I run flutter pub get
into /ios directory, it changes automatically the ios/Flutter/Release.xcconfig
file to:
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
And running pod install
:
carolinaalbuquerque ~/Documents/audio_recognition_app/ios (*main) > pod install
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 3 dependencies from the Podfile and 5 total pods installed.
[!] CocoaPods did not set the base configuration of your project because your project already has
a custom config set. In order for CocoaPods integration to work at all, please either set the base
configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig`
or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration
(`Flutter/Release.xcconfig`).
Also, if I replace my ios/Flutter/Release.xcconfig
file with yours, the same warning appears. The suggestion given by warning has already in file, so I don't understand what might be misconfigured 😞 Here is my Xcode configurations:
Hmm, I’ll get back to you about this problem
As for Xcode version, I’m using 12.4
@Caldarie thanks for your time! I tried to reinstall Xcode, update pods and finally it works! Sorry for your time and thanks again! 😁
Glad I could be of assistance!
Running my application in iOS device (iPhone 7 with iOS 14.4) it crashes when the model is processing the data. I believe that happens due to Tensorflow Lite Errors (see output) but I have no idea how to fix it:
I am using a Google Teachable Machine model and I followed these steps for iOS configuration.
I have tested already in Android device and it works perfectly but I need to guarantee iOS support!