From 8811098244019388fb0c527c285b64a347ad6a72 Mon Sep 17 00:00:00 2001 From: nyagato_00 Date: Sat, 29 Aug 2020 17:39:37 +0900 Subject: [PATCH] TFLITE_USE_DELEGATE has been changed to use GpuDelegateOptions instead of TFLGpuDelegateOptions. When I tried to run the sample using the GPU-supported version of TensorFlow Lite, I encountered an exception on line 419 of tensorflow/lite/examples/ios/camera/CameraExampleViewController.mm. The exceptions that occurred are as follows "Unknown type name 'TFLGpuDelegateOptions'; did you mean 'GpuDelegateOptions'?" Using GpuDelegateOptions seemed to be the right thing to do, so I modified the code to use this one. Official tutorial: https://www.tensorflow.org/lite/performance/gpu#ios_with_xcode --- .../examples/ios/camera/CameraExampleViewController.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tensorflow/lite/examples/ios/camera/CameraExampleViewController.mm b/tensorflow/lite/examples/ios/camera/CameraExampleViewController.mm index 665131195e4..7f060034012 100644 --- a/tensorflow/lite/examples/ios/camera/CameraExampleViewController.mm +++ b/tensorflow/lite/examples/ios/camera/CameraExampleViewController.mm @@ -387,7 +387,7 @@ void ProcessInputWithQuantizedModel( - (void)dealloc { #if TFLITE_USE_GPU_DELEGATE if (delegate) { - TFLGpuDelegateDelete(delegate); + DeleteGpuDelegate(delegate); } #endif [self teardownAVCapture]; @@ -416,10 +416,10 @@ void ProcessInputWithQuantizedModel( tflite::InterpreterBuilder(*model, resolver)(&interpreter); #if TFLITE_USE_GPU_DELEGATE - TFLGpuDelegateOptions options; + GpuDelegateOptions options; options.allow_precision_loss = true; - options.wait_type = TFLGpuDelegateWaitTypeActive; - delegate = TFLGpuDelegateCreate(&options); + options.wait_type = GpuDelegateOptions::WaitType::kActive; + delegate = NewGpuDelegate(&options); interpreter->ModifyGraphWithDelegate(delegate); #endif