Yuji
Yuji

Reputation: 704

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

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.

Upvotes: 3

Views: 1220

Answers (1)

yyoon
yyoon

Reputation: 3845

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.

Upvotes: 2

Related Questions