错误:当使用量化图构建tensorflow android时,'nanf'不是'std'的成员

时间:2016-05-23 18:06:12

标签: android linux c++11 android-ndk tensorflow

我正在尝试使用自己的图形构建谷歌Android示例。 我使用了here解释的量化方法。 我在构建文件中添加了“// tensorflow / contrib / quantization:cc_ops”和“// tensorflow / contrib / quantization / kernels:quantized_ops”。 当我运行bazel build //tensorflow/examples/android:tensorflow_demo时 我收到以下错误ERROR: /home/dani/tensorflow/tensorflow/core/BUILD:1065:1: C++ compilation of rule '//tensorflow/core:gpu_runtime' failed: arm-linux-androideabi-gcc failed: error executing command external/androidndk/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -fstack-protector-strong -fpic -ffunction-sections -funwind-tables ... (remaining 95 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1. tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc: In member function 'virtual void* tensorflow::GPUNanResetAllocator::AllocateRaw(std::size_t, std::size_t)': tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc:169:53: error: 'nanf' is not a member of 'std' std::vector<float> nans(req_size / sizeof(float), std::nanf("")); ^ tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc:169:53: note: suggested alternative: In file included from external/androidndk/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/cmath:44:0, from external/androidndk/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/complex:44, from ./tensorflow/core/framework/numeric_types.h:19, from ./tensorflow/core/framework/allocator.h:24, from ./tensorflow/core/common_runtime/visitable_allocator.h:20, from ./tensorflow/core/common_runtime/gpu/gpu_debug_allocator.h:23, from tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc:16: external/androidndk/ndk/platforms/android-21/arch-arm/usr/include/math.h:354:7: note: 'nanf' float nanf(const char *) __NDK_FPABI_MATH__ __pure2; ^ tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc: In member function 'virtual void tensorflow::GPUNanResetAllocator::DeallocateRaw(void*)': tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc:182:53: error: 'nanf' is not a member of 'std' std::vector<float> nans(req_size / sizeof(float), std::nanf("")); ^ tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc:182:53: note: suggested alternative: In file included from external/androidndk/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/cmath:44:0, from external/androidndk/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/complex:44, from ./tensorflow/core/framework/numeric_types.h:19, from ./tensorflow/core/framework/allocator.h:24, from ./tensorflow/core/common_runtime/visitable_allocator.h:20, from ./tensorflow/core/common_runtime/gpu/gpu_debug_allocator.h:23, from tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc:16: external/androidndk/ndk/platforms/android-21/arch-arm/usr/include/math.h:354:7: note: 'nanf' float nanf(const char *) __NDK_FPABI_MATH__ __pure2; ^ Target //tensorflow/examples/android:tensorflow_demo failed to build 我已尝试同时使用android-ndk-r10eandroid-ndk-r11。 谢谢,丹

0 个答案:

没有答案