简体   繁体   English

为 macOS 构建 TensorFlow Lite C++ API 的正确命令是什么?

[英]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.我成功地使用了基于 macOS 的 TensorFlow Lite C++ API for Android。

Now I want to try it for macOS since TensorFlow Lite support Metal delegate (for iOS?).现在我想在 macOS 上尝试它,因为 TensorFlow Lite 支持 Metal 委托(对于 iOS?)。 You know, TensorFlow itself has stopped supporting GPU on macOS several years ago.要知道,TensorFlow 本身在几年前就已停止在 macOS 上支持 GPU。

What is a proper command to build TensorFlow Lite C++ API for macOS?为 macOS 构建 TensorFlow Lite C++ API 的正确命令是什么?

For Android,对于安卓,

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

I have no idea about config for macOS.我不知道 macOS 的配置。 But I think that it should exist because tflite_runtime package exists for macOS.但我认为它应该存在,因为 tflite_runtime 包存在于 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.这将为 x86_64 macos 构建.so文件。 That being said, the Metal delegate is probably not included in the final binary, as Metal delegate is specifically targeting iOS.话虽如此,Metal 委托可能不包含在最终的二进制文件中,因为 Metal 委托专门针对 iOS。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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