Building tensorflow 1.10 succeeded but package installation fails - tensorflow

I try to build tensorflow 1.10 with cuda from a python3 virtual environment :
./configure succeeded
first step build with bazel succeeded (with the necessity to install additional things)
$ bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
At first time the build failed:
import keras_applications
ModuleNotFoundError: No module named 'keras_applications'
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 9114.151s, Critical Path: 335.72s
INFO: 6696 processes: 6696 local.
FAILED: Build did NOT complete successfully
But after having installed some keras components and h5py:
pip install keras_applications==1.0.4 --no-deps
Collecting keras_applications==1.0.4
Downloading https://files.pythonhosted.org/packages/54/90/8f327deaa37a71caddb59b7b4aaa9d4b3e90c0e76f8c2d1572005278ddc5/Keras_Applications-1.0.4-py2.py3-none-any.whl (43kB)
100% |████████████████████████████████| 51kB 633kB/s
Installing collected packages: keras-applications
Successfully installed keras-applications-1.0.4
(DeepFish) jeanpat#Dell-T5500:~/Developpement/Arch-TensorFlow/tensorflow$ pip install keras_preprocessing==1.0.2 --no-deps
Collecting keras_preprocessing==1.0.2
Downloading https://files.pythonhosted.org/packages/71/26/1e778ebd737032749824d5cba7dbd3b0cf9234b87ab5ec79f5f0403ca7e9/Keras_Preprocessing-1.0.2-py2.py3-none-any.whl
Installing collected packages: keras-preprocessing
Successfully installed keras-preprocessing-1.0.2
(DeepFish) jeanpat#Dell-T5500:~/Developpement/Arch-TensorFlow/tensorflow$ pip install h5py==2.8.0
Collecting h5py==2.8.0
Downloading https://files.pythonhosted.org/packages/8e/cb/726134109e7bd71d98d1fcc717ffe051767aac42ede0e7326fd1787e5d64/h5py-2.8.0-cp36-cp36m-manylinux1_x86_64.whl (2.8MB)
100% |████████████████████████████████| 2.8MB 1.9MB/s
Requirement already satisfied: numpy>=1.7 in /home/jeanpat/anaconda3/envs/DeepFish/lib/python3.6/site-packages (from h5py==2.8.0) (1.15.0)
Requirement already satisfied: six in /home/jeanpat/anaconda3/envs/DeepFish/lib/python3.6/site-packages (from h5py==2.8.0) (1.11.0)
keras-applications 1.0.4 has requirement keras>=2.1.6, but you'll have keras 2.0.8 which is incompatible.
Installing collected packages: h5py
Found existing installation: h5py 2.7.1
Uninstalling h5py-2.7.1:
Successfully uninstalled h5py-2.7.1
Successfully installed h5py-2.8.0
It was possible to finish the build:
Target //tensorflow/tools/pip_package:build_pip_package up-to-date:
bazel-bin/tensorflow/tools/pip_package/build_pip_package
INFO: Elapsed time: 55.947s, Critical Path: 29.05s
INFO: 40 processes: 40 local.
INFO: Build completed successfully, 43 total actions
second step build succeeded too with some warnings:
$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
jeudi 23 août 2018, 15:02:24 (UTC+0200) : === Preparing sources in dir: /tmp/tmp.dEwVvSzrd0
~/Developpement/Arch-TensorFlow/tensorflow ~/Developpement/Arch-TensorFlow/tensorflow
~/Developpement/Arch-TensorFlow/tensorflow
jeudi 23 août 2018, 15:02:31 (UTC+0200) : === Building wheel
warning: no files found matching '.pd' under directory ''
warning: no files found matching '.dll' under directory ''
warning: no files found matching '.lib' under directory ''
warning: no files found matching '*.h' under directory 'tensorflow/include/tensorflow'
warning: no files found matching '*' under directory 'tensorflow/include/Eigen'
warning: no files found matching '*.h' under directory 'tensorflow/include/google'
warning: no files found matching '*' under directory 'tensorflow/include/third_party'
warning: no files found matching '*' under directory 'tensorflow/include/unsupported'
jeudi 23 août 2018, 15:03:09 (UTC+0200) : === Output wheel file is in: /tmp/tensorflow_pkg
Finally I tried to install the python package:
$ pip install /tmp/tensorflow_pkg/tensorflow-1.10.0-py2-none-any.whl
Requirement '/tmp/tensorflow_pkg/tensorflow-1.10.0-py2-none-any.whl' looks like a filename, but the file does not exist
tensorflow-1.10.0-py2-none-any.whl is not a supported wheel on this platform.

Package installation succeeded with:
$ pip install /tmp/tensorflow_pkg/tensorflow*.whl

Related

Pipx can not build packages when trying to install eth-brownie

I got a following error code while trying to install brownie through pipx (by typing "pipx install eth-brownie)
PS C:\Users\J.M\demos\brownie_simple_storage> pipx install eth-brownie
Fatal error from pip prevented installation. Full pip output in file:
C:\Users\J.M\.local\pipx\logs\cmd_2023-01-08_01.26.02_pip_errors.log
pip failed to build packages:
bitarray
cytoolz
lru-dict
multidict
psutil
regex
yarl
Some possibly relevant errors from pip install:
error: subprocess-exited-with-error
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
Error installing eth-brownie.
PS C:\Users\J.M\demos\brownie_simple_storage>
I have all the prerequirements (node.js, recent python version, ganache cli, npm all successfully installed), I really have no idea why it can't build those packages.

Does compilation start from beginning or resume after fixing error while building Tensorflow from source?

I need to compile Tensorflow from source for compute capability 3.0
I was compiling Tensorflow and I got this error after 6 hours of compiling:
cache/bazel/_bazel_maydin/435ff134a8a529ccec16636685173684/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_2_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/keras/preprocessing/__init__.py", line 21, in <module>
import keras_preprocessing
ModuleNotFoundError: No module named 'keras_preprocessing'
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 20674.165s, Critical Path: 247.43s
INFO: 12297 processes: 12297 local.
FAILED: Build did NOT complete successfully
In below link, I found this answer and I think it will work.
Error Compiling Tensorflow From Source - No module named 'keras_applications'
pip install keras_applications==1.0.4 --no-deps
pip install keras_preprocessing==1.0.2 --no-deps
pip install h5py==2.8.0
I also got similar error before beginning of build where it says numpy is missing, i just installed it via pip and build started without problem.
But I am scared to run build command again. Because I don't want to compile everything 6 hours again.
If I start building again does it start all over from beginning or it continue from where it failed?
Build command I used is this:
bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
I cloned tensorflow repository, checkout to branch 2.0 and started build.
Additional info about system:
Cuda 10.0.130
cuDNN 7.6.2
Bazel 0.26.1
Ubuntu 18.04
It resumes compiling where it left off after fixing errors.

error in bazel/ tensorflow installation 'external:io_bazel_rules_closure: no such attribute 'urls' in 'http_archive' rule.'

Hi all I am trying to install tensor flow with GPU compatibility using this guide "guide 1" and guide 2 on ubuntu pc (cuda 8). I am stuck at installing tensorflow,
when I use ./configure, I getting this error
ERROR: /home/krishna/tensorflow/WORKSPACE:3:1: //external:io_bazel_rules_closure: no such attribute 'urls' in 'http_archive' rule.
ERROR: /home/krishna/tensorflow/WORKSPACE:3:1: //external:io_bazel_rules_closure: missing value for mandatory attribute 'url' in 'http_archive' rule.
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '#io_bazel_rules_closure//closure': error loading package 'external': Could not load //external package.
I am new to ubuntu, after reading a lot I understood that, the error has something to do with "version of bazel" (for version above 0.3.1 it does not apper).
When I use the command
$bazel version
Build label: 0.3.0
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Jun 10 11:38:23 2016 (1465558703)
Build timestamp: 1465558703
Build timestamp as int: 1465558703
when i use
$ sudo apt-get install bazel
Reading package lists... Done
Building dependency tree
Reading state information... Done
bazel is already the newest version (0.4.5).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
and
upgraded it using $ sudo apt-get upgrade bazel. Finally I tried
$ bazel version
Build label: 0.3.0
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Jun 10 11:38:23 2016 (1465558703)
Build timestamp: 1465558703
Build timestamp as int: 1465558703
which shows me that I am at version 0.3.0. I even tried compiling tensorflow again,which gave me the same above error.
It looks like you have two versions of Bazel on your system (0.3.0 and 0.4.5). You can see what the current binary is by running which bazel. You can find all of the bazels on your system by running:
$ updatedb # This will take a while.
$ slocate bazel
Assuming this returns something like:
/etc/bazel/bin/bazel
/usr/bin/bazel
you can figure out which bazel is the "right" one (0.4.5) by running /usr/bin/bazel version etc. for each bazel slocate finds.
Once you find the right bazel, you want that to be the default, so you have to make sure Linux searches for Bazel in that directory first. If the right bazel is /usr/local/bin/bazel, you'd run:
$ export PATH="/usr/local/bin:$PATH"
Then you should be able to call "bazel" normally and your system will find the "right" one (you can also delete any old ones you find).
Alternatively, you can install Bazel using the installer which will tell you what directory it got installed in.

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

TensorFlow: Extension file not found: 'google/protobuf/protobuf.bzl'

I am following this tutorial to install GPU-enabled TensorFlow that is compatible with CUDA Compute Capability 3.0.
I installed Java-JDK8, Bazel 0.1.0, TensorFlow 0.6.0, and changed the configurations to run on CUDA Compute Capability 3.0. Everything is good so far.
But when I enter this command:
$HOME/bin/bazel build -c opt --config=cuda
//tensorflow/cc:tutorials_example_trainer
I see this output:
Extracting Bazel installation...
.....
ERROR: /home/me/tensorflow/tensorflow/core/BUILD:1: Extension file not found: 'google/protobuf/protobuf.bzl'.
ERROR: /home/me/tensorflow/tensorflow/cc/BUILD:65:1: error loading package 'tensorflow/core': Extension file not found: 'google/protobuf/protobuf.bzl' and referenced by '//tensorflow/cc:tutorials_example_trainer'.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 1.006s
Any advice?
The problem is fixed by running this command:
$ git clone -b 0.6.0 –recurse-submodules https://github.com/tensorflow/tensorflow.git
The error message I received is documented here. Pulling all submodules fixed the problem.
I've had issues with the command above, -recurse-submodules does not exist
Try this:
$ git clone --recursive git#github.com:tensorflow/tensorflow.git