tensorflow / flutter-tflite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Undefined name 'TfLiteGpuInferenceUsage' and 'TfLiteGpuInferencePrioFrity'.

Lucisokiu opened this issue · comments

image

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?

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