How to install TensorFlow-gpu with cuda8.0? - tensorflow

I tried to install it according to the instructions on official website, which results in an ImportError when I import tensorflow:
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
I run the code cat /usr/local/cuda/version.txt, which shows that my cuda version is 8.0.61.
It seems that tensorflow is looking for cuda 9.0. I cannot upgrade the cuda as I am working on a shared gpu-server and I do not have the root authority.
Is there any way to make tensorflow work with cuda 8.0? Or any other way available?
Thanks!!

You'll need to install the version 1.4.1 for CUDA-8 as
pip install tensorflow-gpu==1.4.1
The latest (version 1.5) is for CUDA-9

I was facing the similar issue, until I found
https://www.tensorflow.org/install/install_sources#tested_source_configurations
check your installed cuda version and cudnn version and then find out which version of tensorflow-gpu is compatible with those using link mentioned above.
I had installed cuda 8 and cudnn v5.1, hence by checking above link tensorflow-gpu 1.2.0 was compatible and after installing that using
pip install tensorflow-gpu==1.2.0
It worked for me.

Related

How to solve "ERROR: No matching distribution found for tensorflow==1.12.0"

I am trying to install tensorflow 1.12.0. This is the command that I am using pip install tensorflow==1.12.0. I got this command from this link. This is the error that I am getting.
ERROR: Could not find a version that satisfies the requirement
tensorflow==1.12.0 (from versions: 2.5.0rc0, 2.5.0rc1, 2.5.0rc2,
2.5.0rc3, 2.5.0) ERROR: No matching distribution found for tensorflow==1.12.0
What am I doing wrong?
You can install previous versions of Tensorflow directly from the Github release page. For example, the 1.12.0 version can be downloaded from https://github.com/tensorflow/tensorflow/releases/tag/v1.12.0.
My python version was 3.9. Intalling python version 3.6 solved the problem. I installed it in virtual environment with conda.

how to install compatible version of cudnn for tensorflow using conda

I trying to ran a python code on gpu using tensorflow-gpu=1.6.0
I have installed tensorflow using conda command that suppose to install all the required lib
when I run the code I get the error below:
Loaded runtime CuDNN library: 7605 (compatibility version 7600) but source was compiled with 7102 (compatibility version 7100). If using a binary install, upgrade your CuDNN library to match. If building from sources, make sure the library loaded at runtime matches a compatible version specified during compile configuration.
2021-02-16 02:29:34.892462: F tensorflow/core/kernels/conv_ops.cc:717] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo(), &algorithms)
anybody could help me how to find and install the compatible version using conda in order to solve this issue...thanks in advance
This page lists tensorflow/cudnn compatibility:
https://www.tensorflow.org/install/source#linux
seems you will need to install cudnn 7 rather than 7.6 to use tf 1.6.0

Tensorflow 1.15 + CUDA + cuDNN installation using Conda

I am trying to install tensorflow-gpu 1.15 using Conda for an easy install of CUDA and cuDNN. The problem is that checking the compatibility chart of the official web I need python 3.6, CUDA 10.0 and cuDNN 7.4.
Searching the Conda rep via conda search cudnn it says that there isn't cuDNN 7.4. Is there any other way to install the required packages? Or maybe tensorflow 1.15 also works with other combinations of versions?
As a side note, python 3.6, tensorflow-gpu 1.15 and CUDA 10 install correctly, but it seems I can't use the GPU correctly without cuDNN.
I just recently started using Conda, so maybe there is a straight forward way to do this that I don't realize. My Conda version is 4.9.1 (miniconda version).
---update---
Just in case I add the error while trying conda create -n myenv -c conda-forge tensorflow-gpu=1.15:
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found to be incompatible with each other:
Output in format: Requested package -> Available versions
Package _tflow_select conflicts for:
_tflow_select==2.1.0=gpu
tensorflow==1.15.0 -> _tflow_select[version='2.1.0|2.3.0|2.2.0',build='gpu|mkl|eigen']
Note that strict channel priority may have removed packages required for satisfiability.
I am not sure if that is the problem, but I installed the following way
conda create -n tensorflow1.15 python=3.5
conda activate tensorflow1.15
conda install cudatoolkit=10.0
conda install cudnn=7.3.1
pip3 install tensorflow-gpu==1.15
And it seems to works perfectly with the GPU. I didn't know that cuDNN 7.3.1 worked like 7.4. The best way is to install tensorflow with conda, but it give me an error of trying to install tensorflow-gpu=2.X.
Also maybe it's interesting to say that you can search CUDA and similar official installers with conda search -c nvidia <packageName>.
I would let conda handle all the dependencies itself by installing tensorflow via conda, not pip. The GPU version of tensorflow is available e.g. in the popular conda-forge channel:
conda create -n myenv -c conda-forge tensorflow-gpu=1.15
The best setup for TensorFlow 1.15 is to follow this guide here: https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/tensorflow-1.14/install.html#tf-install. The CUDA version which is recommended is 10.0 and the cudNN version 7.6.5
Attention to the protobuf version which will be installed, if you execute the gpu version it's 4.21.1, but you have to rewrite it with the command: pip install --upgrade tensorflow-gpu==1.15 "protobuf<4.0". If you use the cpu version its recommended to use this version here:(https://github.com/protocolbuffers/protobuf/releases/tag/v3.4.0) to avoid errors.Just download the protoc-3.4.0-win32.zip (windows)
Hope that helps.

Tensorflow 1.15 cannot detect gpu with Cuda10.1

I have installed both tensorflow 2.2.0 and tensorflow 1.15.0(by pip install tensorflow-gpu==1.15.0). The tensorflow 2 is installed in the base environment of Anaconda 3, while the tensorflow 1 is installed in a separate environment.
The tensorflow 2.2.0 can recognize gpu based on a simple test:
if tf.test.gpu_device_name():
print('Default GPU Device: {}'.format(tf.test.gpu_device_name()))
//output: Default GPU Device: /device:GPU:0
But the tensorflow 1.15.0 can not detect gpu.
For your information, my system environment is python + cuda 10.1 + vs 2015.
The tensosflow versions 1.15.0 to 1.15.3 (the latest version) are all compiled against Cuda 10.0. Downgrading the cuda 10.1 to cuda 10.0 solved the problem.
Also be aware of the python version. It is recommended to install the tensorflow .whl file (as listed at https://nero-mirror.stanford.edu/pypi/simple/tensorflow-gpu/) for the specific python version. As for installation, see How do I install a Python package with a .whl file?
Tensorflow 1.15 expects cuda 10.0 , but I managed to make it work with cuda 10.1 by installing the following packages with Anaconda: cudatoolkit (10.0) and cudnn (7.6.5). So, after running
conda install cudatoolkit=10.0
conda install cudnn=7.6.5
tensorflow 1.15 was able to find and use GPU (which is using cuda 10.1).
PS: I understand your environment is Windows based, but this question pops on Google for the same problem happening on Linux (where I tested this solution). Might be useful also on Windows.
It might have to do with the version compatibility of TF, Cuda and CuDNN. This post has it discussed thoroughly.
Have you tried installing Anaconda? it downloads all the requirements and make it easy for you with just a few clicks.

Installing tensorflow-gpu 1.3.0 on windows 10

I have been trying to install tensorflow-gpu on windows 10, via
pip3 install --upgrade tensorflow-gpu
When I do this I break the current installation of ordinary tensorflow!, and get this error: On Windows, running "import tensorflow" generates No module named "_pywrap_tensorflow" error.
Somehow I manage to fix this by re-installing ordinary tensorflow, but then when I import tensorflow in python 3.5.2 and try to identify my GPU, No device is found!
I have a Cuda 9.0 installed alongside cudnn64_6 defined as a DLL in CUDA/v9.0/bin, and I can run the nbody test program without problems and I can see the GPU being used for that demo application.
Is there any known issue with tensorflow-gpu 1.3.0?
Really struggling on this. Why does it have to be so problematic installing this library!
Please help
mg
TensorFlow 1.3 (and 1.4) require CUDA 8.0 and do not support later versions. You will either need to downgrade CUDA to 8.0 or make a custom build from source.