GpuDelegateV2 , Tfile is not working for IOS it shows Error in flutter

Viewed 25

GpuDelegateV2 , TFile is not working for IOS it shows Error, But it is working fine for android, and when I'm trying to load the tfile model for ios with tfile_flutter package it shows error and can't load the tfile model. I have provided the code below


    try {
      final gpuDelegateV2 = tflite.GpuDelegateV2(

          options: tflite.GpuDelegateOptionsV2(

              isPrecisionLossAllowed: false,

              inferencePreference:

                  tflite.TfLiteGpuInferenceUsage.fastSingleAnswer,

              inferencePriority1: tflite.TfLiteGpuInferencePriority.minLatency,

              inferencePriority2: tflite.TfLiteGpuInferencePriority.auto,

              inferencePriority3: tflite.TfLiteGpuInferencePriority.auto));
      var interpreterOptions = tflite.InterpreterOptions()

        ..addDelegate(gpuDelegateV2);

      _interpreter = await tflite.Interpreter.fromAsset('mobilefacenet.tflite',

          options: interpreterOptions);

      print('model loaded successfully');

      print('model loaded successfully');

      print('load model1===model loaded successfully');

    } catch (e) {

       print('load model2===.$e');

    }

  }
0 Answers
Related