Ubuntu16.04编译tensorflow官方Android demo
来源:互联网 发布:java开源bug管理系统 编辑:程序博客网 时间:2024/05/05 00:39
1.下载tensorflow官方代码
git clone --recurse-submodules https://github.com/tensorflow/tensorflow.git
2.下载Android SDK和Android NDK
Android SDK下载:在安装Android Studio时进行选择,
https://developer.android.com/studio/index.html?hl=zh-cnAndroid NDK
下载地址:https://developer.android.com/ndk/downloads/older_releases.html
选择NDK r12b进行下载,高版本(r14b)目前编译可能报如下错误
tensorflow/core/kernels/BUILD:4542:1: C++ compilation of rule '//tensorflow/core/kernels:android_tensorflow_kernels' failed: clang failed: error executing command external/androidndk/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -gcc-toolchain external/androidndk/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -fpic -ffunction-sections ... (remaining 73 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
3.编辑tensorflow/WORKSPACE文件,取消部分注释后并填入sdk和ndk路径后如下
# Uncomment and update the paths in these entries to build the Android demo.android_sdk_repository( name = "androidsdk", api_level = 26, # Ensure that you have the build_tools_version below installed in the # SDK manager as it updates periodically. build_tools_version = "25.0.2", # Replace with path to Android SDK on your system path = "/home/sc/Android/Sdk",)## Android NDK r12b is recommended (higher may cause issues with Bazel)android_ndk_repository( name="androidndk", path="/home/sc/android-ndk-r12b",# # This needs to be 14 or higher to compile TensorFlow.# # Please specify API level to >= 21 to build for 64-bit# # archtectures or the Android NDK will automatically select biggest# # API level that it supports without notice.# # Note that the NDK version is not the API level. api_level=24)build_tools_version参考Sdk下面build-tools文件夹名称,api_level为SDK对应的Android版本对应数字
好几分钟后,就会有编译成功的提示
Target //tensorflow/examples/android:tensorflow_demo up-to-date: bazel-bin/tensorflow/examples/android/tensorflow_demo_deploy.jar bazel-bin/tensorflow/examples/android/tensorflow_demo_unsigned.apk bazel-bin/tensorflow/examples/android/tensorflow_demo.apkINFO: Elapsed time: 394.902s, Critical Path: 56.04s生成的apk文件位于bazel-bin/tensorflow/examples/android/文件夹下
阅读全文
0 0
- Ubuntu16.04编译tensorflow官方Android demo
- Ubuntu16.04 编译ijkplayer so,并导入android,运行官方demo
- Ubuntu16.04编译Tensorflow
- 编译TensorFlow Android Camera Demo
- Ubuntu16.04/16.10下Tensorflow demo在Android上的移植
- Android中运行TensorFlow程序1-运行官方demo
- Ubuntu 使用 Android Studio 编译 TensorFlow android demo
- Ubuntu 使用 Android Studio 编译 TensorFlow android demo
- TensorFlow Android Camera Demo编译安装(Ubuntu Trusty 14.04 LTS)
- tensorflow+ubuntu16.04
- Ubuntu16.04配置TensorFlow
- Ubuntu16.04安装tensorflow
- Ubuntu16.04 Tensorflow安装
- ubuntu16.04 安装tensorflow
- ubuntu16.04安装tensorflow
- 解析Tensorflow官方PTB模型的demo
- 解析Tensorflow官方English-Franch翻译器demo
- 解析Tensorflow官方English-Franch翻译器demo
- MyEclipse8.6证书注册代码
- poj 2104 K-th Number
- 如何快速搭建vpn(pptp型)
- 复权因子
- STL的erase()陷阱-迭代器失效总结
- Ubuntu16.04编译tensorflow官方Android demo
- Leetcode 66. Plus One
- bootstrap在线富文本编辑器
- 一级缓存(15)
- 从 RequireJs 源码剖析脚本加载原理
- hdu6105 Gameia 2017多校第六场1010 树+博弈
- Linux DNS
- java修饰符
- HDU_1251 统计难题 【字典树||map】