0
votes

When I build quantization tool use the command "bazel build tensorflow/tools/graph_transforms:transform_graph"

The complie result as below:

WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.build/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.

INFO: Found 1 target...

ERROR: /root/tensorflow-master/tensorflow/core/BUILD:1287:1: C++ compilation of rule '//tensorflow/core:framework_internal' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 106 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.

tensorflow/core/framework/reader_op_kernel.cc:20:61: error: definition of implicitly-declared 'tensorflow::ReaderOpKernel::ReaderOpKernel(tensorflow::OpKernelConstruction*)' ReaderOpKernel::ReaderOpKernel(OpKernelConstruction* context) ^ tensorflow/core/framework/reader_op_kernel.cc:27:33: error: definition of implicitly-declared 'virtual tensorflow::ReaderOpKernel::~ReaderOpKernel()' ReaderOpKernel::~ReaderOpKernel() { ^

tensorflow/core/framework/reader_op_kernel.cc:34:50: error: no 'void tensorflow::ReaderOpKernel::Compute(tensorflow::OpKernelContext*)' member function declared in class 'tensorflow::ReaderOpKernel' void ReaderOpKernel::Compute(OpKernelContext* ctx) { ^ Target //tensorflow/tools/graph_transforms:transform_graph failed to build

Use --verbose_failures to see the command lines of failed build steps.

INFO: Elapsed time: 5.989s, Critical Path: 5.02s

What's the problem?

Thanks!

1

1 Answers

1
votes

Please try two things: (1) configure the compile environment first and then compile, like

./configure

bazel build tensorflow/tools/graph_transforms:transform_graph

(2) You can also try:

sudo bazel build tensorflow/tools/graph_transforms:transform_graph

Point (2) worked for me sometimes to remove dependencies of including header files.

please download the latest tensorflow and bazel, if needed.