Bazel build error, to use graph transform to reduce the size of .pb model - tensorflow

A question when I was trying to use command Bazel build to build TensorFlow. After I entered this command:
bazel build tensorflow/tools/graph_transforms:transform_graph
The compile started, and about 3 minutes later, it said
this (below you can see I check my cudnn and cuda version)
Anyone could help me with this?

Works on my machine
Just did a checkout of TensorFlow:
git clone https://github.com/tensorflow/tensorflow.git
Then build the target (using bazelisk):
bazelisk build tensorflow/tools/graph_transforms:transform_graph
The build of the target succeeds:
INFO: Elapsed time: 2111.652s, Critical Path: 293.22s
INFO: 5811 processes: 5811 local.
INFO: Build completed successfully, 5969 total actions
CUDA version check:
cat /usr/local/cuda/version.txt gives me CUDA Version 10.0.130
bazelisk version gives me 1.1.0
lsb_release -a
results in:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
Your machine
There is an error reported:
unsupported gpu architecture 'compute_36'
It seems that nvcc cannot compile your CUDA code, since the define GPU architecture is not supported.
Also, Bazel advises you to use the --verbose_failures flag to get more details about our error.

Related

Tensorflow build error on Orange Pi Pc Plus

I'm trying to build Tensorflow 1.7.1 on Orange Pi Pc Plus (Allwinner H3, ARM Cortex A7) running ARMBIAN 5.38 stable Ubuntu 16.04.4 LTS 4.14.18-sunxi, and using Bazel 0.10.0 as per the official release, I followed this tutorial, I built Bazel successfully, but when I try to build Tensorflow using -mfpu=neon-vfpv4 flag for optimization:
bazel build -c opt --compilation_mode=opt --copt="-mfpu=neon-vfpv4" --copt="-funsafe-math-optimizations" --copt="-ftree-vectorize" --copt="-fomit-frame-pointer" --copt="-std=gnu99" --local_resources 500,2.0,1.0 --verbose_failures tensorflow/tools/pip_package:build_pip_package
I get the following error:
bazel-out/arm-opt/bin/_solib_arm/_U_S_Stensorflow_Scontrib_Slite_Stoco_Ctoco___Utensorflow/libtensorflow_framework.so:
error: undefined reference to 'png_init_filter_functions_neon'
I have tried installing both libpng16-dev and libpng12-dev, but the error still occurs.
It turns out that until May 2018, the only official version of tensorflow that builds successfully on ARM without any modifications is revision d82b2f71b60d5fff48884c20c7b85e517330e91f, according to tensorflow's official CI server data, this is the latest successful build for ARM (Raspberry Pi) to date. The exact error reported in this question shows up in the official nightly build of the next revision.

Tensorflow Custom Compile on Windows

So, I've installed Bazel via Chocolatey, installed Python 3.5 and 2.7, installed CUDA v8, and cuDNN v6, and installed JDK 8.0, I'm now trying to custom-build TensorFlow on my Windows 10 device, with AVX, AVX 2 and CUDA. TensorFlow-GPU, the pre-built version, does work, I've already tested and run that successfully.
I've followed the instructions of other articles, both on TensorFlows' actual site (trying to adapt some sections from the Linux/Mac installs), and on here. The furthest I've made it is; cloning the Github repository via Msys2, running configure.py, then attempting to build via bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package I receive an error, the header of which is:
Error reading java.io.IOException: CreateProcess(): The system cannot find the file specified.
: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/include/cudnn.h
I've double checked, that file does exist, so I'm not sure why I'm getting this error.
EDIT: Also attempted to run via Powershell, reached the same point.
Any help would be much appreciated.
I had the exact same error while trying to build Tensorflow on Windows (using cuDNN 5.1). I fixed it by launching bazel from the msys2 terminal (instead of from the windows command prompt) and manually setting the BAZEL_SH environment variable before attempting to build.
export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
bazel build -c opt --config=win-cuda tensorflow/cc:cc_ops
The following steps helped me to compile Tensorflow on Windows 10.
pacman -Syuu patch
ln -s "c:\python27\python.exe" /usr/bin/python
export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
"C:\Documents and Settings\All Users\chocolatey\bin\bazel.exe" build --config=opt --config=win-cuda //tensorflow/tools/pip_package:build_pip_package
But after 1 hour of compilation I got another error:
C:\tools\msys64\tmp_bazel_dmitry\x1e5egqw\execroot\org_tensorflow\external\protobuf_archive\python\google\protobuf\internal\api_implementation.cc
: fatal error C1083: Cannot open compiler generated file: '': Invalid
argument Target //tensorflow/tools/pip_package:build_pip_package
failed to build

building tensorboard from source

I built Tensorflow from source and built Tensorboard via
bazel build tensorflow/contrib/tensorboard:tensorboard
The build process finished but there is no tensorboard folder in
./bazel-bin/tensorflow or ./bazel-bin/tensorflow/contrib
any ideas how to find the binary so i can run
./bazel-bin/tensorflow/contrib/tensorboard/tensorboard --logdir=path/to/logs
?
OS: Ubuntu 16.04
Tensorflow for Python3 with GPU support
Thanks in advance
Tensorboard is in its own repository now. Try:
git clone https://github.com/tensorflow/tensorboard
cd tensorboard
bazel build //tensorboard
...
Target //tensorboard:tensorboard up-to-date:
bazel-bin/tensorboard/tensorboard
INFO: Elapsed time: 87.181s, Critical Path: 50.59s
Then you can find it at bazel-bin/tensorboard/tensorboard.

Tensorflow bazel build failing - not generating bazel-bin directory

I'm trying to install Tensorflow from the source using the following configuration:
NVIDIA GTX 1070
UBUNTU 16.04
CUDA 8.0
Cudnn v5.0
I have followed the following steps from here:
installed bazel
installed dependencies
installed CUDA support
./configure with CUDA 8.0 support
bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
After this step, to my knowledge, there should be a bazel-bin directory, so that I can subsequently execute
$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
# The name of the .whl file will depend on your platform.
$ sudo pip install /tmp/tensorflow_pkg/tensorflow-0.10.0rc0-py2-none-any.whl
However, there is no such directory.
I have a feeling this error message might have something to do with it?
ERROR: /usr/local/lib/python2.7/dist-packages/tensorflow_clone/tensorflow/contrib/rnn/BUILD:45:1: error while parsing .d file: /home/volcart/.cache/bazel/_bazel_volcart/62dff5ffffc63bcd8a9350984645e0be/execroot/tensorflow_clone/bazel-out/local_linux-opt/bin/tensorflow/contrib/rnn/_objs/python/ops/_lstm_ops_gpu/tensorflow/contrib/rnn/kernels/lstm_ops_gpu.cu.pic.d (No such file or directory).
nvcc warning : option '--relaxed-constexpr' has been deprecated and replaced by option '--expt-relaxed-constexpr'.
In file included from third_party/gpus/cuda/include/cuda_runtime.h:78:0,
from <command-line>:0:
third_party/gpus/cuda/include/host_config.h:115:2: error: #error -- unsupported GNU version! gcc versions later than 5.3 are not supported!
#error -- unsupported GNU version! gcc versions later than 5.3 are not supported!
Upon re-executing bazel build ... I found this...
WARNING: /usr/local/lib/python2.7/dist-packages/tensorflow/util/python/BUILD:11:16: in includes attribute of cc_library rule //util/python:python_headers: 'python_include' resolves to 'util/python/python_include' not in 'third_party'. This will be an error in the future.
I should also add this...
$ bazel version
Build label: 0.3.1
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Jul 29 09:09:52 2016 (1469783392)
Build timestamp: 1469783392
Build timestamp as int: 1469783392
bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
Caused a permissions issue. Added sudo
sudo bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

How do I check Bazel version?

I am trying to find out which version of Bazel I currently have on my computer to install TensorFlow from source (it requires version 0.1.4)
evan#evan-box:~/Apps/tensorflow$ bazel --version
Unknown Bazel startup option: '--version'.
For more info, run 'blaze help startup_options'.
evan#evan-box:~/Apps/tensorflow$ bazel version
Build label: head (#125b349)
Build target: bazel-out/local_linux-fastbuild/bin/src/main/java/bazel-main_deploy.jar
Build time: Fri Nov 13 01:23:30 2015 (1447377810)
Build timestamp: 1447377810
Build timestamp as int: 1447377810
So where is the version actually?
See Bazel users manual
From the command line:
$ bazel version
Build label: 0.1.1
Since bazel version 0.27.0 there is bazel --version available, without the side-effect of starting the server daemon.