Install an older version of Tensorflow GPU - python

I was tring to install older version of tensorflow gpu on windows 10:
pip install tensorflow-gpu==1.4.0
And I get an error like this other post impling there is no windows version
And I'm wondering if there is a way to get the list of functionning windows tensorflow version
Thanks in advance
Edits
It seems that tensorflow GPU v1.4.0 doesn't work on python 3.7 therefore creating another enviromment and downgrading your python version to 3.6 may resolve the issue.
by using anaconda you can do it this way
conda create -n py36 python=3.6
conda activate py36
pip install tensorflow-gpu==1.4.0
note that another older version of CUDA is required for older version of tensorflow (I had to install CUDA 8.0)

If you go to the pypi page of tensorflow 1.4, you can see, that only whl files up to python 3.6 are available. I am guessing that you are either using 3.7 or 3.8. That is why
pip install tensorflow-gpu==1.4.0
is not working for you. There simply is no installation candidate for tensorflow-gpu for python versions other than 2.7, 3.3, 3.4, 3.5, 3.6
I think you have two options, since you mentioned that you have conda:
Create an environment
Create an environment that is using python 3.6 and then use pip install like you originally intended
conda create -n py36 python=3.6
conda activate py36
pip install tensorflow-gpu==1.4.0
Try a channel that has your version
You can use the search function on the website to locate a channel that has your specific version available, for 1.4, you should be able to do:
conda install -c cjj3779 tensorflow-gpu
No version specification neccessary, as the only available version in that channel is 1.4

Option 1: Installing with pip, but only available versions
Looking at the error message pip created it shows that tensorflow-gpu==1.4.0 is not available.
In order to see available versions, check the versions within parenthesis:
ERROR: Could not find a version that satisfies the requirement tensorflow-gpu==1.4.0
(from versions: 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0,
1.15.0rc0, 1.15.0rc1, 1.15.0rc2, 1.15.0rc3, 1.15.0, 2.0.0a0, 2.0.0b0, 2.0.0b1,
2.0.0rc0, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.1.0rc0, 2.1.0rc1, 2.1.0rc2)
ERROR: No matching distribution found for tensorflow-gpu==1.4.0
Then select the one fits you from available ones:
pip install tensorflow-gpu==1.14.0
Option 2: Installing with Conda
Go with this tutorial: https://www.datacamp.com/community/tutorials/installing-anaconda-windows
After you install Anaconda to Windows:
1) Create an environment:
conda create -n tf_gpu python=3.6 anaconda
2) Activate this environment:
conda activate tf_gpu
3) Install tf-gpu 1.4:
conda install tensorflow-gpu=1.4

Related

How to install older version of Tensorflow?

I follow this tutorial. He uses Tensorflow 1.10.0. I should use that version too. Because tutorial is not compatible with newer versions of Tensorflow.
So,when I open Anaconda Prompt and write
pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.10.0-py3-none-any.whl
to base and I see this long error message. How can install Tensorflow 1.10.0?
I also tried:
conda create --name="tfold" python=3.7
conda activate tfold
pip install tensorflow==1.10.0
and I see this error message:
ERROR: Could not find a version that satisfies the requirement tensorflow==1.10.0 (from versions: none)
ERROR: No matching distribution found for tensorflow==1.10.0
EDIT: The oldest version compatible with Python 3.7 is 1.13. I installed Python 3.6. Then, I installed it using conda create -n test_env tensorflow=1.10.0
I think the problem is because you are using python3.7
Try using pip and not pip3
Set python=2.7 and use pip install tensorflow==1.10, it worked fine for me.

Force Anaconda to install tensorflow 1.14

Now, the official TensorFlow on Anaconda is 2.0. My question is how to force Anaconda to install an earlier version of TensorFlow instead. So, for example, I would like Anaconda to install TensorFlow 1.14 as plenty of my projects are depending on this version.
You can force installing a certain version of any package found on Anaconda using simply an = operator with the package version attached to it.
So, if you want to install tensorflow 1.14, you can run the following command:
conda install -c conda-forge tensorflow=1.14
You can replace 1.14 with any other versions. To see the available versions of tensorflow on Anaconda, you can run:
conda search tensorflow
first find the python version of tensorflow==1.14.0, then find the Anaconda version by python version.
e.g. tensorflow 1.14.0 can work well on python36, and Anaconda 3.5.1 has python36. So install the Anaconda 3.5.1, then install tensorflow==1.14.0 by pip

Unable to install tensorflow=1.0.0

I am trying to install tensorflow 1.0.0 on windows 10 , but, it's showing this error message:
Could not find a version that satisfies the requirement tensorflow==1.0 (from versions ...
No matching distribution found for tensorflow==1.0
I have already tried to install using anaconda v 5.2, Python v 3.6
Try by creating python 3.5 env in anaconda it should work.
conda create --name tf1.0 pip python=3.5
activate tf1.0
pip install tensorflow==1.0
I faced the same problem. Then after much hardships, I got to know that anaconda versions>=4.2.0 don't support the direct installation of tensorflow version 1.0.0, So, I installed anaconda version=4.2.0 and works perfectly now.
it takes direct installation:
pip install tensorflow==1.0.0

How to downgrade tensorflow, multiple versions possible?

I have tensorflow 1.2.1 installed, and I need to downgrade it to version 1.1 to run a specific tutorial. What is the safe way to do it? I am using windows 10, python 3.5. Tensorflow was installed with pip3, but "pip3 show tensorflow" returns blank.
Is it possible to have multiple version of tensorflow on the same OS?
Pip allows to specify the version
pip install tensorflow==1.1
I discovered the joy of anaconda: https://www.continuum.io/downloads. It allows multiple virtual environments to host different versions of phyton and tensorflow. For example the following creates a virtual environment with pyton3.5 and tensorflow1.1
C:> conda create -n tensorflow1.1 python=3.5
C:> activate tensorflow1.1
(tensorflow1.1)
C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.1.0-cp35-cp35m-win_amd64.whl
voila, a virtual environment is created.
Is it possible to have multiple version of tensorflow on the same OS?
Yes, you can use python virtual environments for this. From the docs:
A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable.
After you have install virtualenv (see the docs), you can create a virtual environment for the tutorial and install the tensorflow version you need in it:
PATH_TO_PYTHON=/usr/bin/python3.5
virtualenv -p $PATH_TO_PYTHON my_tutorial_env
source my_tutorial_env/bin/activate # this activates your new environment
pip install tensorflow==1.1
PATH_TO_PYTHON should point to where python is installed on your system.
When you want to use the other version of tensorflow execute:
deactivate my_tutorial_env
Now you can work again with the tensorflow version that was already installed on your system.
If you are using python3 on windows then you might do this as well
pip3 install tensorflow==1.4
you may select any version from "(from versions: 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0)"
I did this when I wanted to downgrade from 1.7 to 1.4
Pay attention: you cannot install arbitrary versions of tensorflow, they have to correspond to your python installation, which isn't conveyed by most of the answers here. This is also true for the current wheels like here (from this answer above). For this example, the cp35-cp35m found inside the url hints that it is for Python 3.5.x
A huge list of different wheels/compatibilities can be found here on github.
By using this, you can downgrade to almost every availale version in combination with the respective for python. For example:
pip install tensorflow==2.0.0
(note that previous to installing Python 3.7.8 alongside version 3.8.3 in my case, you would get this:
ERROR: Could not find a version that satisfies the requirement tensorflow==2.0.0 (from versions: 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.3.0rc0, 2.3.0rc1)
ERROR: No matching distribution found for tensorflow==2.0.0
this also holds true for other non-compatible combinations.)
This should also be useful for legacy CPU without AVX support or GPUs with a compute capability that's too low.
If you only need the most recent releases (which it doesn't sound like in your question) a list of urls for the current wheel packages is available on this tensorflow page. That's from this SO-answer.
Note: This link to a list of different versions didn't work for me.
You can try to use the options of --no-cache-dir together with -I to overwrite the cache of the previous version and install the new version. For example:
pip3 install --no-cache-dir -I tensorflow==1.1
Then use the following command to check the version of tensorflow:
python3 -c ‘import tensorflow as tf; print(tf.__version__)’
It should show the right version got installed.
If you have anaconda, you can just install desired version and conda will automatically downgrade the current package for you.
For example:
conda install tensorflow=1.1
Click to green checkbox on installed tensorflow and choose needed version
You can downgrade TensorFlow version to a lower version by running:
1.Check the version of TensorFlow that currently installed by:
pip3 show tensorflow
2.Then, Downgrade TensorFlow to a lower version by running:
pip3 install --upgrade tensorflow==<version>
Set the version to a lower number than the currently installed release. When choosing, make sure the version is compatible with the Python release.
If you are using a Notebook environment, run the following command and restart the kernel when the installation completes:
!pip install --upgrade tensorflow==<version>
Although the best practice is to use the latest version of Python and
TensorFlow since older versions have vulnerability issues. So be
cautious when downgrading.

Tensorflow r1.0 : could not a find a version that satisfies the requirement tensorflow

I want to install Tensorflow 1.o for python on windows.
This is information for my system.
D:\>python --version
Python 3.5.2 :: Anaconda 4.2.0 (32-bit)
D:\>pip3 --version
pip 9.0.1 from d:\web\anaconda\lib\site-packages (python 3.5)'
But, when I execute below command,
D:\>pip3 install tensorflow
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow
I don't understand what the problem is...
And I tried another way...
This is case when I use Conda
(tensorflow) D:\>pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0-cp35-cp35m-win_x86_64.whl
tensorflow-1.0.0-cp35-cp35m-win_x86_64.whl is not a supported wheel on this platform.
What is the problem?
I was in same problem.
Below command solved my problem
pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.0-py3-none-any.whl
to find the list of all the urls based on the python version and CPU or GPU only refer to:
https://www.tensorflow.org/install/pip
Tensorflow requires a 64-bit version of Python.
Additionally, it only supports Python 3.5.x through Python 3.8.x.
If you're using a 32-bit version of Python or a version that's too old or new, then you'll get that error message.
To fix it, you can install the 64-bit version of Python 3.8.6 via Python's website.
Tensorflow on windows needs python 3.5. You can follow following steps to activate python 3.5 in anaconda:
See which version of python you have: conda search python
If you already have python 3.5 then go to step 3
otherwise use conda create -n py35 python=3.5 anaconda to create python 3.5
Activate python 3.5 using activate py35
Now install tensorflow using conda install tensorflow
If step4 is not working i.e, something like "tensorflow: no package found " then follow this tutorial to forge conda-forge channel and then try installing tensorflow using step4. It worked for me.
Try this
Installing with Anaconda
conda create --name tensorflow python=3.5
activate tensorflow
conda install jupyter
conda install scipy
pip install tensorflow
or
pip install tensorflow-gpu
It is important to add python=3.5 at the end of the first line, because it will install Python 3.5.
I was getting the same error
Get Python 3.5
Upgrade pip version to 9
Install tensorflow
It worked for me
I did it with:
python3 -m pip install --upgrade tensorflow
From your python version output, looks like that you are using Anaconda python, in that case, there is a simple way to install tensorflow.
conda install -c conda-forge tensorflow
This command will take care of all dependencies like upgrade/downgrade etc.
upgrading pip worked for me
python -m pip install --upgrade pip
i had python 3.8.5 ..but it will not work with tenserflow..
so i installed python 3.7.9 and it worked.
The solution for me was sooo dumb!!
I was using Python 3.8 in my environment. I made a new environment using Python 3.7, and the install worked fine.
source
The TensorFlow package couldn't be found by the latest version of the "pip".
To be honest, I really don't know why this is...
but, the quick fix that worked out for me was:
[In case you are using a virtual environment]
downgrade the virtual environment to python-3.8.x and pip-20.2.x
In case of anaconda, try:
conda install python=3.8
This should install the latest version of python-3.8 and pip-20.2.x for you.
And then, try
pip install tensorflow
Again, this worked fine for me, not sure if it'll work the same for you.
The Reason is that TensorFlow is only available upto python versions <= 3.6. You can't download tensorflow for python versions > 3.6 as there is no tensorflow.
If you don't want to downgrade your entire python version for a single package, do this:
create a new virtual environment for that project (using anaconda)
conda create -n <env_name> python=3.6.8
activate the created environment using conda activate <env_name>
Now install pip install tensorflow
note: If tensorflow dosen't install : try install keras module first and then try installing tensorflow

Categories