Skip to content

useMetalDelegateForIOS = true results in Interpreter not being able to load #286

@Bassiuz

Description

@Bassiuz

Hello all,

I am trying to run a TFLite Yolo V8 model with Metal Delegate on iOS. I am testing on a physical device (iPhone 13).

When running the TFLite Analyze function, it returns

Your model looks compatible with GPU delegate on TFLite runtime version 2.16.1.
This does not guarantee that your model will work well with GPU delegate because there could still be runtime incompatibililties.

Which makes me question if there are runtime incompatibliities here.

Here is my code sample and error it results in;

  final options = InterpreterOptions()..threads = 2;
  options.useMetalDelegateForIOS = true; // Use Metal Delegate for iOS

  final mainInterpreter = Interpreter.fromBuffer(
    initData.interpreterBuffer,
    options: options,
  );

Results in

[ERROR:flutter/runtime/dart_isolate.cc(1380)] Unhandled exception:
Invalid argument(s): Unable to create interpreter.
#0      checkArgument (package:quiver/check.dart:45:5)
check.dart:45
#1      new Interpreter._create (package:tflite_flutter/src/interpreter.dart:58:5)
interpreter.dart:58
#2      new Interpreter.fromBuffer (package:tflite_flutter/src/interpreter.dart:109:37)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions