Repository navigation
Description
ERROR: /XXX/tensorflow/core/kernels/BUILD:2632:1: C++ compilation of rule '//tensorflow/core/kernels:quantized_ops' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-canonical-system-headers ... (remaining 125 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
tensorflow/core/kernels/quantize_op.cc: In instantiation of 'void tensorflow::QuantizeV2Op<Device, T>::Compute(tensorflow::OpKernelContext*) [with Device = Eigen::ThreadPoolDevice; T = Eigen::QInt16]':
tensorflow/core/kernels/quantize_op.cc:166:1: required from here
tensorflow/core/kernels/quantize_op.cc:116:33: error: no matching function for call to 'std::function<float(float)>::function()'
.unaryExpr(std::function<float(float)>(round))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./tensorflow/core/framework/op.h:19:0,
from tensorflow/core/kernels/quantize_op.cc:20:
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2115:7: note: candidate: template<class _Functor, class, class> std::function<_Res(_ArgTypes ...)>::function(_Functor)
function<_Res(_ArgTypes...)>::
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2115:7: note: template argument deduction/substitution failed:
tensorflow/core/kernels/quantize_op.cc:116:33: note: couldn't deduce template parameter '_Functor'
.unaryExpr(std::function<float(float)>(round))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./tensorflow/core/framework/op.h:19:0,
from tensorflow/core/kernels/quantize_op.cc:20:
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1897:7: note: candidate: std::function<_Res(_ArgTypes ...)>::function(std::function<_Res(_ArgTypes ...)>&&) [with _Res = float; _ArgTypes = {float}]
function(function&& __x) : _Function_base()
^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1897:7: note: no known conversion for argument 1 from '' to 'std::function<float(float)>&&'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2101:5: note: candidate: std::function<_Res(_ArgTypes ...)>::function(const std::function<_Res(_ArgTypes ...)>&) [with _Res = float; _ArgTypes = {float}]
function<_Res(_ArgTypes...)>::
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2101:5: note: no known conversion for argument 1 from '' to 'const std::function<float(float)>&'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1877:7: note: candidate: std::function<_Res(_ArgTypes ...)>::function(std::nullptr_t) [with _Res = float; _ArgTypes = {float}; std::nullptr_t = std::nullptr_t]
function(nullptr_t) noexcept
^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1877:7: note: no known conversion for argument 1 from '' to 'std::nullptr_t'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1870:7: note: candidate: std::function<_Res(_ArgTypes ...)>::function() [with _Res = float; _ArgTypes = {float}]
function() noexcept
^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1870:7: note: candidate expects 0 arguments, 1 provided
tensorflow/core/kernels/quantize_op.cc: In instantiation of 'void tensorflow::QuantizeV2Op<Device, T>::Compute(tensorflow::OpKernelContext*) [with Device = Eigen::ThreadPoolDevice; T = Eigen::QUInt16]':
tensorflow/core/kernels/quantize_op.cc:166:1: required from here
tensorflow/core/kernels/quantize_op.cc:116:33: error: no matching function for call to 'std::function<float(float)>::function()'
.unaryExpr(std::function<float(float)>(round))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./tensorflow/core/framework/op.h:19:0,
from tensorflow/core/kernels/quantize_op.cc:20:
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2115:7: note: candidate: template<class _Functor, class, class> std::function<_Res(_ArgTypes ...)>::function(_Functor)
function<_Res(_ArgTypes...)>::
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2115:7: note: template argument deduction/substitution failed:
tensorflow/core/kernels/quantize_op.cc:116:33: note: couldn't deduce template parameter '_Functor'
.unaryExpr(std::function<float(float)>(round))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./tensorflow/core/framework/op.h:19:0,
from tensorflow/core/kernels/quantize_op.cc:20:
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1897:7: note: candidate: std::function<_Res(_ArgTypes ...)>::function(std::function<_Res(_ArgTypes ...)>&&) [with _Res = float; _ArgTypes = {float}]
function(function&& __x) : _Function_base()
^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1897:7: note: no known conversion for argument 1 from '' to 'std::function<float(float)>&&'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2101:5: note: candidate: std::function<_Res(_ArgTypes ...)>::function(const std::function<_Res(_ArgTypes ...)>&) [with _Res = float; _ArgTypes = {float}]
function<_Res(_ArgTypes...)>::
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2101:5: note: no known conversion for argument 1 from '' to 'const std::function<float(float)>&'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1877:7: note: candidate: std::function<_Res(_ArgTypes ...)>::function(std::nullptr_t) [with _Res = float; _ArgTypes = {float}; std::nullptr_t = std::nullptr_t]
function(nullptr_t) noexcept
^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1877:7: note: no known conversion for argument 1 from '' to 'std::nullptr_t'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1870:7: note: candidate: std::function<_Res(_ArgTypes ...)>::function() [with _Res = float; _ArgTypes = {float}]
function() noexcept
^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1870:7: note: candidate expects 0 arguments, 1 provided
tensorflow/core/kernels/quantize_op.cc: In instantiation of 'void tensorflow::QuantizeV2Op<Device, T>::Compute(tensorflow::OpKernelContext*) [with Device = Eigen::ThreadPoolDevice; T = Eigen::QInt8]':
tensorflow/core/kernels/quantize_op.cc:166:1: required from here
tensorflow/core/kernels/quantize_op.cc:116:33: error: no matching function for call to 'std::function<float(float)>::function()'
.unaryExpr(std::function<float(float)>(round))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./tensorflow/core/framework/op.h:19:0,
from tensorflow/core/kernels/quantize_op.cc:20:
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2115:7: note: candidate: template<class _Functor, class, class> std::function<_Res(_ArgTypes ...)>::function(_Functor)
function<_Res(_ArgTypes...)>::
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2115:7: note: template argument deduction/substitution failed:
tensorflow/core/kernels/quantize_op.cc:116:33: note: couldn't deduce template parameter '_Functor'
.unaryExpr(std::function<float(float)>(round))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./tensorflow/core/framework/op.h:19:0,
from tensorflow/core/kernels/quantize_op.cc:20:
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1897:7: note: candidate: std::function<_Res(_ArgTypes ...)>::function(std::function<_Res(_ArgTypes ...)>&&) [with _Res = float; _ArgTypes = {float}]
function(function&& __x) : _Function_base()
^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1897:7: note: no known conversion for argument 1 from '' to 'std::function<float(float)>&&'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2101:5: note: candidate: std::function<_Res(_ArgTypes ...)>::function(const std::function<_Res(_ArgTypes ...)>&) [with _Res = float; _ArgTypes = {float}]
function<_Res(_ArgTypes...)>::
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2101:5: note: no known conversion for argument 1 from '' to 'const std::function<float(float)>&'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1877:7: note: candidate: std::function<_Res(_ArgTypes ...)>::function(std::nullptr_t) [with _Res = float; _ArgTypes = {float}; std::nullptr_t = std::nullptr_t]
function(nullptr_t) noexcept
^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1877:7: note: no known conversion for argument 1 from '' to 'std::nullptr_t'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1870:7: note: candidate: std::function<_Res(_ArgTypes ...)>::function() [with _Res = float; _ArgTypes = {float}]
function() noexcept
^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1870:7: note: candidate expects 0 arguments, 1 provided
tensorflow/core/kernels/quantize_op.cc: In instantiation of 'void tensorflow::QuantizeV2Op<Device, T>::Compute(tensorflow::OpKernelContext*) [with Device = Eigen::ThreadPoolDevice; T = Eigen::QUInt8]':
tensorflow/core/kernels/quantize_op.cc:166:1: required from here
tensorflow/core/kernels/quantize_op.cc:116:33: error: no matching function for call to 'std::function<float(float)>::function()'
.unaryExpr(std::function<float(float)>(round))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./tensorflow/core/framework/op.h:19:0,
from tensorflow/core/kernels/quantize_op.cc:20:
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2115:7: note: candidate: template<class _Functor, class, class> std::function<_Res(_ArgTypes ...)>::function(_Functor)
function<_Res(_ArgTypes...)>::
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2115:7: note: template argument deduction/substitution failed:
tensorflow/core/kernels/quantize_op.cc:116:33: note: couldn't deduce template parameter '_Functor'
.unaryExpr(std::function<float(float)>(round))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./tensorflow/core/framework/op.h:19:0,
from tensorflow/core/kernels/quantize_op.cc:20:
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1897:7: note: candidate: std::function<_Res(_ArgTypes ...)>::function(std::function<_Res(_ArgTypes ...)>&&) [with _Res = float; _ArgTypes = {float}]
function(function&& __x) : _Function_base()
^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1897:7: note: no known conversion for argument 1 from '' to 'std::function<float(float)>&&'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2101:5: note: candidate: std::function<_Res(_ArgTypes ...)>::function(const std::function<_Res(_ArgTypes ...)>&) [with _Res = float; _ArgTypes = {float}]
function<_Res(_ArgTypes...)>::
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:2101:5: note: no known conversion for argument 1 from '' to 'const std::function<float(float)>&'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1877:7: note: candidate: std::function<_Res(_ArgTypes ...)>::function(std::nullptr_t) [with _Res = float; _ArgTypes = {float}; std::nullptr_t = std::nullptr_t]
function(nullptr_t) noexcept
^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1877:7: note: no known conversion for argument 1 from '' to 'std::nullptr_t'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1870:7: note: candidate: std::function<_Res(_ArgTypes ...)>::function() [with _Res = float; _ArgTypes = {float}]
function() noexcept
^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/functional:1870:7: note: candidate expects 0 arguments, 1 provided
Activity
thjashin commentedon Nov 7, 2016
Also found by me when compiling using gcc 6.2.0
aselle commentedon Nov 7, 2016
@benoitsteiner, it looks like an Eigen related compilation problem.
pavelchristof commentedon Nov 7, 2016
Replacing the problematic line (tensorflow/core/kernels/quantize_op.cc:116) with
.unaryExpr([] (float r) -> float { return round(r); })works.
drpngx commentedon Nov 8, 2016
What happens when you pass &::round? Or &std::round?
Use the native Eigen round() method instead of std::function<float(fl…
benoitsteiner commentedon Nov 9, 2016
I rewrote the code to avoid calling std::round in fb60813.
Unfortunately I don't have gcc 6.2 installed so I couldn't verify that this solves the problem. Can you try and let me know if it works for you ?
thjashin commentedon Nov 9, 2016
@benoitsteiner It works with gcc-6.2.0.
benoitsteiner commentedon Nov 9, 2016
Thanks, closing this issue
Update from original Nov 14 (#1)