What is a proper command to build TensorFlow Lite C++ API for macOS?

Viewed 776

I am successfully using TensorFlow Lite C++ API for Android, which is built on macOS.

Now I want to try it for macOS since TensorFlow Lite support Metal delegate (for iOS?). You know, TensorFlow itself has stopped supporting GPU on macOS several years ago.

What is a proper command to build TensorFlow Lite C++ API for macOS?

For Android,

bazel build -c opt --config=android_arm64 //tensorflow/lite:libtensorflowlite.so

I have no idea about config for macOS. But I think that it should exist because tflite_runtime package exists for macOS.

Thank you.

1 Answers

Can you try the following?

bazel build -c opt --cpu=darwin //tensorflow/lite:libtensorflowlite.so

This will build the .so file for x86_64 macos. That being said, the Metal delegate is probably not included in the final binary, as Metal delegate is specifically targeting iOS.

Related