2017-01-03 5 views
0

1:www.tensorflow.org/versions/master/get_started/os_setup.html#sourceで推奨されるBazelのバージョンを入手してください 私はpipインストールを使用します:$ pip install tensorflowテンソルフローのbazelビルドでAPKを取得することはできません

2:NDKとSDKをインストールし、私はSDKとNDKのAndroidでメーカー 3の両方をインストール:以下excute: $カール-L https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip -o /tmp/inception5h.zip $カール-L https://storage.googleapis.com/download.tensorflow.org/models/mobile_multibox_v1.zip -oを/ tmp/mobile_multibox_v1.zip

$ unzip /tmp/inception5h.zip -d tensorflow/examples/android/assets/ $ unzip/tmp/mobこのステップの後にこのエラーが発生しました。ile_multibox_v1.zip -d tensorflow/examples/android/assets/

4:$ bazel build // tensorflow/examples/android:tensorflow_demo

WARNING: Bazel Android NDK crosstools are based on Android NDK revision 12. The revision of the Android NDK given in android_ndk_repository rule 'androidndk' is '13.1.3345770'. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:avgpooling_op.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:bounds_check.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:cwise_ops.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:cwise_ops_common.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:cwise_ops_gradients.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:eigen_activations.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:eigen_attention.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:eigen_backward_cuboid_convolutions.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:eigen_backward_spatial_convolutions.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:eigen_cuboid_convolution.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:eigen_patch_3d.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:eigen_pooling.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:eigen_softmax.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:eigen_spatial_convolutions.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:fifo_queue.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:maxpooling_op.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:ops_util.cc' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:ops_util.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:padding_fifo_queue.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:pooling_ops_common.cc' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:pooling_ops_common.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:queue_base.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:queue_op.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/kernels:typed_queue.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/util/ctc:ctc_beam_entry.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/util/ctc:ctc_beam_scorer.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/util/ctc:ctc_beam_search.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/util/ctc:ctc_decoder.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/util/ctc:ctc_loss_util.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/util/tensor_bundle:naming.cc' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/util/tensor_bundle:naming.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/util/tensor_bundle:tensor_bundle.cc' directly. You should either move the file to this package or depend on an appropriate rule there. 
WARNING: /Users/Rauha/tensorflow/tensorflow/core/BUILD:779:12: in srcs attribute of cc_library rule //tensorflow/core:android_tensorflow_lib_lite: please do not import '//tensorflow/core/util/tensor_bundle:tensor_bundle.h' directly. You should either move the file to this package or depend on an appropriate rule there. 
INFO: Found 1 target... 
INFO: From Compiling external/protobuf/src/google/protobuf/util/time_util.cc [for host]: 
external/protobuf/src/google/protobuf/util/time_util.cc:52:18: warning: unused variable 'kMicrosPerMillisecond' [-Wunused-const-variable] 
static const int kMicrosPerMillisecond = 1000; 
       ^
external/protobuf/src/google/protobuf/util/time_util.cc:56:19: warning: unused variable 'kTimestampFormat' [-Wunused-const-variable] 
static const char kTimestampFormat[] = "%E4Y-%m-%dT%H:%M:%S"; 
       ^
2 warnings generated. 
INFO: From Linking external/protobuf/libprotobuf_lite.a [for host]: 
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/host/bin/external/protobuf/_objs/protobuf_lite/external/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_gcc.o has no symbols 
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/host/bin/external/protobuf/_objs/protobuf_lite/external/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.o has no symbols 
INFO: From Linking external/protobuf/libprotobuf.a [for host]: 
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/host/bin/external/protobuf/_objs/protobuf/external/protobuf/src/google/protobuf/io/gzip_stream.o has no symbols 
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/host/bin/external/protobuf/_objs/protobuf/external/protobuf/src/google/protobuf/util/internal/error_listener.o has no symbols 
INFO: From ProtoCompile tensorflow/examples/android/proto/box_coder.pb.cc: 
bazel-out/android-arm-linux-androideabi-4.9-v7a-gnu-libstdcpp-fastbuild/genfiles/external/protobuf/src: warning: directory does not exist. 
INFO: From ProtoCompile tensorflow/core/example/example.pb.cc: 
bazel-out/android-arm-linux-androideabi-4.9-v7a-gnu-libstdcpp-fastbuild/genfiles/external/protobuf/src: warning: directory does not exist. 
INFO: From ProtoCompile tensorflow/core/example/example.pb.cc [for host]: 
bazel-out/host/genfiles/external/protobuf/src: warning: directory does not exist. 
INFO: From Processing Android resources for //tensorflow/examples/android:tensorflow_demo: 
Jan 03, 2017 1:56:28 PM com.google.devtools.build.android.AndroidDataMerger doMerge 
WARNING: 
CONFLICT: asset:WORKSPACE is provided with ambiguous priority from: 
    external/mobile_multibox/WORKSPACE 
    external/inception5h/WORKSPACE 
CONFLICT: asset:BUILD is provided with ambiguous priority from: 
    tensorflow/examples/android/assets/BUILD 
    external/inception5h/BUILD 
Error: Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest. 
**ERROR:** /Users/Rauha/tensorflow/tensorflow/examples/android/BUILD:58:1: Java compilation in rule '//tensorflow/examples/android:tensorflow_demo' failed: Worker process sent response with exit code: 1. 
tensorflow/examples/android/src/org/tensorflow/demo/CameraActivity.java:120: error: method does not override or implement a method from a supertype 
    @Override 
^
tensorflow/examples/android/src/org/tensorflow/demo/CameraActivity.java:137: error: cannot find symbol 
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 
                ^
    symbol: variable M 
    location: class VERSION_CODES 
tensorflow/examples/android/src/org/tensorflow/demo/CameraActivity.java:138: error: cannot find symbol 
     return checkSelfPermission(PERMISSION_CAMERA) == PackageManager.PERMISSION_GRANTED && checkSelfPermission(PERMISSION_STORAGE) == PackageManager.PERMISSION_GRANTED; 
      ^
    symbol: method checkSelfPermission(String) 
    location: class CameraActivity 
tensorflow/examples/android/src/org/tensorflow/demo/CameraActivity.java:138: error: cannot find symbol 
     return checkSelfPermission(PERMISSION_CAMERA) == PackageManager.PERMISSION_GRANTED && checkSelfPermission(PERMISSION_STORAGE) == PackageManager.PERMISSION_GRANTED; 
                          ^
    symbol: method checkSelfPermission(String) 
    location: class CameraActivity 
tensorflow/examples/android/src/org/tensorflow/demo/CameraActivity.java:145: error: cannot find symbol 
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 
                ^
    symbol: variable M 
    location: class VERSION_CODES 
tensorflow/examples/android/src/org/tensorflow/demo/CameraActivity.java:146: error: cannot find symbol 
     if (shouldShowRequestPermissionRationale(PERMISSION_CAMERA) || shouldShowRequestPermissionRationale(PERMISSION_STORAGE)) { 
     ^
    symbol: method shouldShowRequestPermissionRationale(String) 
    location: class CameraActivity 
tensorflow/examples/android/src/org/tensorflow/demo/CameraActivity.java:146: error: cannot find symbol 
     if (shouldShowRequestPermissionRationale(PERMISSION_CAMERA) || shouldShowRequestPermissionRationale(PERMISSION_STORAGE)) { 
                    ^
    symbol: method shouldShowRequestPermissionRationale(String) 
    location: class CameraActivity 
tensorflow/examples/android/src/org/tensorflow/demo/CameraActivity.java:149: error: cannot find symbol 
     requestPermissions(new String[] {PERMISSION_CAMERA, PERMISSION_STORAGE}, PERMISSIONS_REQUEST); 
    ^
    symbol: method requestPermissions(String[],int) 
    location: class CameraActivity 
8 errors 
Target //tensorflow/examples/android:tensorflow_demo failed to build 
Use --verbose_failures to see the command lines of failed build steps. 
INFO: Elapsed time: 140.112s, Critical Path: 136.48s 
+1

このエラーは、問題を示しています。 BazelのバージョンはNDKのv12でのみ動作しますが、v13.x.x.xを使用しています。新しいバージョンのBazelまたは古いNDKが必要です。 – Tom

+0

アンドロイド-ndk-r12bを試してみたところ、同じエラーが出ました。 – Rauha

+0

読みやすくするために、エラー出力をコードブロックとしてフォーマットします。 – hotzst

答えて

0

WORKSPACEファイルのSDKにはどのようなAPIレベルを設定していますか?それは> 23以上でなければなりません。そうしないとシンボルエラーが発生します。ターゲットAPIレベルはAndroidManifest.xmlでも23以上必要です。

アプリはまだapiレベル> = 21のデバイスで実行されますが、構築するにはレベル23のSDKを使用する必要があります。

関連する問題