1
votes

Getting protobuf error while compiling TensorFlow Android demo Using Android Studio on OSX.

Steps taken:

  1. installed Bazel upgraded view brew

  2. Cloned tensorflow repo with --recursive flags.

  3. run .configure .

  4. run the project

Error:/private/var/tmp/_bazel_xxxxx/1b55123784db7232f203473c18395341/external/protobuf/BUILD:73:1: C++ compilation of rule '@protobuf//:protobuf_lite' failed: false failed: error executing command /bin/false -MD -MF bazel-out/stub_armeabi-v7a-opt/bin/external/protobuf/_objs/protobuf_lite/external/protobuf/src/google/protobuf/wire_format_lite.pic.d ... (remaining 26 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.

2

2 Answers

1
votes

You'll need to also edit your WORKSPACE file with your NDK and SDK settings according to the directions at https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android. /bin/false errors are typically seen when Bazel can't find the appropriate executable to run, in this case the ndk gcc compiler.

1
votes

If you're looking for a quick way to build the TensorFlow Android demo, you can follow the instructions I wrote in this blog post:
https://medium.com/@daj/creating-an-image-classifier-on-android-using-tensorflow-part-2-9ec0698d801e#.a7kxjliws

To help make this easier, I've created a Docker image that has all the dependencies and configuration you need, so you should just be able to install Docker, download my Docker image, then build. Good luck!

docker pull danjarvis/tensorflow-android:1.0.0