【发布时间】:2021-12-20 23:50:33
【问题描述】:
我正在使用 tflite_flutter 包来加载 tflite 模型。我通过安装包
flutter pub 添加 tflite_flutter
sh install.sh -d 用于使用 GpuDelegateV2
按照我从文档中复制的示例代码。
final gpuDelegateV2 = GpuDelegateV2(
options: GpuDelegateOptionsV2(
false,
TfLiteGpuInferenceUsage.fastSingleAnswer,
TfLiteGpuInferencePriority.minLatency,
TfLiteGpuInferencePriority.auto,
TfLiteGpuInferencePriority.auto,
));
var interpreterOptions = InterpreterOptions()..addDelegate(gpuDelegateV2);
final interpreter = await Interpreter.fromAsset('your_model.tflite',
options: interpreterOptions);
但它给出了异常位置参数过多:预期为 0,但找到了 5。 尝试删除额外的位置参数,或指定命名参数的名称 linter 还在“false”参数上给出了红线。
【问题讨论】:
标签: flutter tensorflow tensorflow-lite