在Mac上构建tensorflow Android演示应用时遇到错误

时间:2017-05-17 00:56:20

标签: android tensorflow

我完全按照this page上的说明操作,但构建仍然失败:

这就是我所做的:

  • 使用python 2.7
  • 设置virtualenv
  • git clone --recurse-submodules https://github.com/tensorflow/tensorflow.git
  • 使用正确的SDK / NDK目录更新WORKSPACE文件。
  • bazel build -c opt //tensorflow/examples/android:tensorflow_demo

它会产生以下错误:

INFO: Found 1 target...
ERROR: /private/var/tmp/_bazel_feisun/a581ef40e662476b21101110ff9ad0b3/external/protobuf/BUILD:241:1: undeclared inclusion(s) in rule '@protobuf//:js_embed':
this rule is missing dependency declarations for the following files included by 'external/protobuf/src/google/protobuf/compiler/js/embed.cc':
  '/Applications/Xcode_8.3.2_fb.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cassert'
  '/Applications/Xcode_8.3.2_fb.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__config'
  '/Applications/Xcode_8.3.2_fb.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include/stdint.h'

搜索了一下,可能需要运行./configure。然后再次运行build命令。同样的错误。

运行:git submodule update --init,然后再次运行该命令。错误更改为:

INFO: Found 1 target...
ERROR: /private/var/tmp/_bazel_feisun/a581ef40e662476b21101110ff9ad0b3/external/protobuf/BUILD:73:1: undeclared inclusion(s) in rule '@protobuf//:protobuf_lite':
this rule is missing dependency declarations for the following files included by 'external/protobuf/src/google/protobuf/repeated_field.cc':
  '/Applications/Xcode_8.3.2_fb.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm'
  '/Applications/Xcode_8.3.2_fb.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__config'
  '/Applications/Xcode_8.3.2_fb.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/initializer_list'

我似乎无法构建演示应用程序。

 bazel version
Build label: 0.4.5-homebrew
Build target: bazel-out/local-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Mar 16 13:39:33 2017 (1489671573)
Build timestamp: 1489671573
Build timestamp as int: 1489671573

gcc --version
Configured with: --prefix=/Applications/Xcode_8.3.2/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /Applications/Xcode_8.3.2/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

0 个答案:

没有答案