简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM