Undefined name 'TfLiteGpuInferenceUsage' and 'TfLiteGpuInferencePrioFrity'.
Lucisokiu opened this issue · comments
Nguyễn Minh Nhựt commented
GpuDelegateV2(
options: GpuDelegateOptionsV2(
isPrecisionLossAllowed: false,
inferencePreference: TfLiteGpuInferenceUsage.TFLITE_GPU_INFERENCE_PREFERENCE_FAST_SINGLE_ANSWER,
inferencePriority1: TfLiteGpuInferencePriority.TFLITE_GPU_INFERENCE_PRIORITY_MAX_PRECISION,
inferencePriority2: TfLiteGpuInferencePriority.TFLITE_GPU_INFERENCE_PRIORITY_AUTO,
inferencePriority3: TfLiteGpuInferencePriority.TFLITE_GPU_INFERENCE_PRIORITY_AUTO,
),
);
Undefined name 'TfLiteGpuInferenceUsage'.
Undefined name 'TfLiteGpuInferencePrioFrity'.
Undefined name 'TfLiteGpuInferencePrioFrity'.
Undefined name 'TfLiteGpuInferencePrioFrity'.
How to fix this problem?
Nguyễn Minh Nhựt commented
I found this way when read in package,
add this line
import 'package:tflite_flutter/src/bindings/tensorflow_lite_bindings_generated.dart';
and i can call TfLiteGpuInferenceUsage and TfLiteGpuInferencePriority
So I can fill in the replacement numbers with 0,1,2,...corresponding to the enum in the abatract class