我尝试使用 GpuDelegate 运行我的模型,但是在创建解释器时出现错误:
Dart 版本:Dart SDK 版本:2.19.6(稳定)
Flutter 版本:Flutter 3.7.9
tflite_flutter:^0.10。 0
Flutter 代码使用 Delegate 加载解释器
Future<Interpreter> loadModel() async {
final options = InterpreterOptions()..threads = 6;
// Use Metal Delegate
// if (Platform.isIOS) {
// options.useNnApiForAndroid = true;
options.addDelegate(GpuDelegate());
// }
// Load model from assets
final interpreter = await Interpreter.fromAsset(
"assets/tflite/keypoint_512_320_float16_V3_1_output.tflite",
options: options);
return interpreter;
}
您找到并解决这个问题了吗?我目前遇到这个问题。