首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当我用bazel来购买libtensorflow_inference.so时

当我用bazel来购买libtensorflow_inference.so时
EN

Stack Overflow用户
提问于 2017-04-21 11:42:21
回答 1查看 514关注 0票数 0

系统:Ubuntu16.04 bazel:0.4.5TensorFlow: cpu版本r1.0 gcc版本:(Ubuntu5.4.0-6 ubuntu1~16.04.4) 5.4.0 20160609

//tensorflow/contrib/android:libtensorflow_inference.so \

-cpu=armeabi-v7a

错误是:

代码语言:javascript
复制
tensorflow/core/kernels/BUILD:3749:1: C++ compilation of rule '//tensorflow/core/kernels:android_tensorflow_kernels' failed: Process exited with status 1 [sandboxed].
tensorflow/core/kernels/split_v_op.cc:212:28: error: non-constant-expression cannot be narrowed from type 'value_type' (aka 'long long') to 'int' in initializer list [-Wc++11-narrowing]
          prefix_dim_size, split_sizes_vec[i], suffix_dim_size};
                           ^~~~~~~~~~~~~~~~~~
tensorflow/core/kernels/split_v_op.cc:172:12: note: in instantiation of member function 'tensorflow::SplitVOpCPU<int, long long>::Compute' requested here
  explicit SplitVOpCPU(OpKernelConstruction* c) : Base(c) {}
           ^
tensorflow/core/kernels/split_v_op.cc:355:19: note: in instantiation of member function 'tensorflow::SplitVOpCPU<int, long long>::SplitVOpCPU' requested here
TF_CALL_ALL_TYPES(REGISTER_SPLIT_LEN);
                  ^
tensorflow/core/kernels/split_v_op.cc:212:28: note: insert an explicit cast to silence this issue
          prefix_dim_size, split_sizes_vec[i], suffix_dim_size};
                           ^~~~~~~~~~~~~~~~~~
                           static_cast<int>( )
tensorflow/core/kernels/split_v_op.cc:212:28: error: non-constant-expression cannot be narrowed from type 'value_type' (aka 'long long') to 'int' in initializer list [-Wc++11-narrowing]
          prefix_dim_size, split_sizes_vec[i], suffix_dim_size};
                           ^~~~~~~~~~~~~~~~~~
tensorflow/core/kernels/split_v_op.cc:172:12: note: in instantiation of member function 'tensorflow::SplitVOpCPU<float, long long>::Compute' requested here
  explicit SplitVOpCPU(OpKernelConstruction* c) : Base(c) {}
           ^
tensorflow/core/kernels/split_v_op.cc:355:19: note: in instantiation of member function 'tensorflow::SplitVOpCPU<float, long long>::SplitVOpCPU' requested here
TF_CALL_ALL_TYPES(REGISTER_SPLIT_LEN);
                  ^
tensorflow/core/kernels/split_v_op.cc:212:28: note: insert an explicit cast to silence this issue
          prefix_dim_size, split_sizes_vec[i], suffix_dim_size};
                           ^~~~~~~~~~~~~~~~~~
                           static_cast<int>( )
tensorflow/core/kernels/split_v_op.cc:212:28: error: non-constant-expression cannot be narrowed from type 'value_type' (aka 'long long') to 'int' in initializer list [-Wc++11-narrowing]
          prefix_dim_size, split_sizes_vec[i], suffix_dim_size};
                           ^~~~~~~~~~~~~~~~~~
tensorflow/core/kernels/split_v_op.cc:172:12: note: in instantiation of member function 'tensorflow::SplitVOpCPU<tensorflow::bfloat16, long long>::Compute' requested here
  explicit SplitVOpCPU(OpKernelConstruction* c) : Base(c) {}
           ^
tensorflow/core/kernels/split_v_op.cc:356:1: note: in instantiation of member function 'tensorflow::SplitVOpCPU<tensorflow::bfloat16, long long>::SplitVOpCPU' requested here
REGISTER_SPLIT_LEN(bfloat16);
^
tensorflow/core/kernels/split_v_op.cc:353:3: note: expanded from macro 'REGISTER_SPLIT_LEN'
  REGISTER_SPLIT(type, int64);
  ^
tensorflow/core/kernels/split_v_op.cc:349:27: note: expanded from macro 'REGISTER_SPLIT'
                          SplitVOpCPU<type, len_type>);
                          ^
tensorflow/core/kernels/split_v_op.cc:212:28: note: insert an explicit cast to silence this issue
          prefix_dim_size, split_sizes_vec[i], suffix_dim_size};
                           ^~~~~~~~~~~~~~~~~~
                           static_cast<int>( )
3 errors generated.
Use --strategy=CppCompile=standalone to disable sandboxing for the failing actions.
Target //tensorflow/contrib/android:libtensorflow_inference.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-04-21 20:38:04

这些错误来自于在Android r13中从gcc到Clang的转换。使用Bazel构建时,要获得最佳效果,请暂时使用NDK r12b。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43541845

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档