I previously installed tensorflow-gpu v 0.12 which worked fine, but for a code of a colleague I need v0.11. So I uninstalled tensorflow and tensorflow-gpu 0.12 and I tried to install v 0.11 with:
pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl
It successfully installs tensorflow, but not the gpu version, even though in the link above I took the gpu and not cpu version. Apparently, it doesn't matter if I choose cpu or gpu, it always only installs the cpu version.
Any idea how to fix this problem?
For tensorflow versions 0.11.x and below there isn't any tensorflow-gpu package in pip. The wheel corresponding to https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl is the correct wheel with gpu support. If you install this wheel via pip, it'll say Installed tensorflow==0.11.0 but has support of CUDA-8. By downloading the individual wheels, for the cpu and gpu folder have a different md5 signature, hence they are different.
See here.
On running
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl
I can successfully install tensorflow v 0.11.
Thaks for #user8289596 answer the following command was useful for my case and i have successfully installed tensorflow 0.11
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0rc0-cp27-none-linux_x86_64.whl
Note: I am using anaconda with python 2.7 and linux
For MacOS, Python 3, this worked for me:
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0-py3-none-any.whl
then install with:
sudo pip3 install --upgrade $TF_BINARY_URL
Source also has instructions for Python 2 and 3 on a variety of Ubuntu/Linux and MacOS configurations.
Related
I installed tensorflow using pip install tensorflow within Anaconda virtual environment on Windows.
I tried to test whether GPU is enabled, and type
import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
and got
Num GPUs Available: 0
My system does have CUDA and CUDNN enabled, as I do not have a problem installing PyTorch GPU version. How do I enable GPU for TensorFlow?
At first, uninstall tensorflow using,
pip uninstall tensorflow
Install tensorflow-gpu version,
pip install tensorflow-gpu==2.2.0
If using pip did't work you can try with conda install command.
conda install -c anaconda tensorflow-gpu
This will automatically install CUDA & cuDNN.
Hope this will solve your issue.
Remove the cpu version tensorflow using pip uninstall tensorflow and install the gpu version of the tensorflow, pip install tensorflow-gpu.
You can check this tutorial link as well.
It can be summarized by the following steps:
Uninstall your old tensorflow
Install tensorflow-gpu pip install tensorflow-gpu
Install Nvidia Graphics Card & Drivers (you probably already have)
Download & Install CUDA
Download & Install cuDNN
Verify with your program.
I just updated the latest MacOS and it wiped everything out.
I follow the steps from this website.
And I start reinstalling the tensorflow with pip3 and it's not installing anything.
I got this error from typing pip3 install --user --upgrade tensorflow .
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
FYI, my MacBook is 64-bit.
and
~ pip3 -V
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
pip 20.2.4 from /Users/zack/Library/Python/3.8/lib/python/site-packages/pip (python 3.8)
~ python3 -V
Python 3.8.2
I don't know what happened does anyone have any ideas.
According to this documentation https://www.tensorflow.org/install/pip#package-location
and your version of python you should run
python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-2.3.0-cp38-cp38-macosx_10_14_x86_64.whl
This is the 3rd step, so check if you got installed correctly the packages from steps 1 and 2
if pip is not up-to-date upgrade pip:
pip install --upgrade pip
then install tensorflow:
pip install tensorflow
for python 3.8 you need to install tensorflow 2.2 or later
system requirements of tensorflow:
Python 3.5–3.8
Python 3.8 support requires TensorFlow 2.2 or later.
pip 19.0 or later (requires manylinux2010 support)
Ubuntu 16.04 or later (64-bit)
macOS 10.12.6 (Sierra) or later (64-bit) (no GPU support)
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.
I have both TF and TF-GPU installed in the same virtual environment. when I test it in iPython terminal, it shows that TensorFlow, not TensorFlow-GPU is used. However, I want the GPU version to be used.
How to do that? Shouldn't I installed both in the same environment? Thanks.
I can recommend this:
pip uninstall tensorflow
pip uninstall tensorflow-gpu
pip install tensorflow
pip install tensorflow-gpu
Wish I knew a better answer
I've searched around and non of the solutions seem to pertain to me, so here I am.
I installed anaconda 5.1 for python 3.6, I downloaded and installed 64-Bit(x86)Installer(551 MB)
from
https://www.anaconda.com/download/#linux
I followed the directions here
https://docs.anaconda.com/anaconda/install/linux
I had the install prepend the path and install microsoft VS code.
I then attempt to install the CPU only tensorflow using anaconda as suggested here
https://www.tensorflow.org/install/install_linux#InstallingAnaconda
I try to install the binary for python 3.6 CPU only
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.6.0-cp36-cp36m-linux_x86_64.whl
I get the following error
tensorflow-1.6.0-cp36-cp36m-linux_x86_64.whl is not a supported wheel on this platform.
I am running a Ubuntu 16.04 VM on windows 10.
edit: when I run this command
pip install --ignore-installed --upgrade tfBinaryURL
outside of the tensorflow environment it worked.
2nd edit:
Additionally I explored my tensorflow environment in my anaconda3 folder, and I noticed it only has python 2.7, so when I tried to install the cpu only tensorflow while in the enviroment for python 2.7 it worked.