I have a running application using which I can recognize faces. In that, .tflite model is working perfectly on Android.
I am facing issues on iOS, in which the application is perfectly running in debug mode, but it is not working in release mode.
Refer to the following code snippet:
Future loadModel() async {
final options = InterpreterOptions();
tempDir = await getApplicationDocumentsDirectory();
print("load");
try {
options.addDelegate(GpuDelegate());
interpreter = await tfl.Interpreter.fromAsset('mobilefacenet.tflite',
options: options);
setState(() {
faceModel = "loaded successfully";
});
} on Exception {
setState(() {
faceModel = "failed to load";
});
print('Failed to load model.');
}
}
ERROR Return:
Unhandled Exception: Invalid argument(s): Failed to lookup symbol 'TFLGpuDelegateCreate': dlsym(RTLD_DEFAULT, TFLGpuDelegateCreate):
The above code is running perfectly on iPhone in Debug mode, but when running it using flutter run --release, the command app is not loading the tflite model.