when i install keras on my conda environement it does not seem to install the latest version since i have 2.0.5 and itseems to be 2.0.8 (https://pypi.python.org/pypi/Keras)
when i run conda update keras i get the following error message :
# All requested packages already installed.
# packages in environment at /home/user/anaconda2/envs/conda_env:
#
keras 2.0.5 py36_0
same problem when i try to install keras-vis but then it does not exist at all so i have to do a pip-install that create double packages in my environement
Conda uses it's own repository of compiled binaries. The latest version available in the main channel "anaconda" is keras 2.0.5. If you use conda-forge you get access to 2.0.6.
Newer versions need to be installed over pip.
EDIT:
You can actually use this channel to get the newer version.
Related
Currently started to learn TFQ and been trying to do this tutorial of tensorflow authors, but if I run the first line (!pip install -q tensorflow==2.3.1 --user) I get this error:
ERROR: pip's dependency resolver does not currently take into account
all the packages that are installed. This behaviour is the source of
the following dependency conflicts. cirq 0.8.0 requires
protobuf==3.8.0, but you have protobuf 3.15.7 which is incompatible.
And when I run the second line (!pip install -q tensorflow-quantum --user) I get this one:
ERROR: pip's dependency resolver does not currently take into account
all the packages that are installed. This behaviour is the source of
the following dependency conflicts. tensorflow 2.3.1 requires
protobuf>=3.9.2, but you have protobuf 3.8.0 which is incompatible.
Cirq 0.8.0 wants protobuf 3.8.0; tensorflow 2.3.1 wants protobuf>=3.9.2 and there is nothing in between and when I do "pip freeze", I only see protobuf==3.8.0, so my pip freeze doesn't see the protobuf 3.15.7 version that the error mentions of (when I do "pip show protobuf" i get the same result of version 3.8.0).
What should I do to prevent this conflict?
Note:
Python version = 3.7.9 (couldn't install tf and/or tfq with either 3.8 nor 3.9);
OS = Windows 10
Installing two different packages on same environment overrides most of the other. This is the way pip works.It is recommended to use virtual environment for each package.
python -m tf_nightly --system-site-packages .\venv
.\venv\Scripts\activate
pip install --upgrade pip
pip install tf-nightly
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
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
Some of my python packages on anaconda cannot be updated to the latest version.
For instance, beautifulsoup4 latest version on anaconda is v4.71 as seen in the release notes.
https://docs.anaconda.com/anaconda/reference/release-notes/
However, when I run conda update beautifulsoup4, the latest version that I can update to is v4.6.
I discovered that the channel used by beautifulsoup4 is pypi.
# Name Version Build Channel
beautifulsoup4 4.6.0 pypi_0 pypi
bleach 3.1.0 py_0 conda-forge
I suspect if I were to change the channel from pypi to conda-forge, I should be able to update to the latest version.
How can I change the channel from pypi to conda-forge? Or does the solution lies somewhere else?
I am using Windows 10 64-bit, python 3.7.
I was running through this problem myself.
Let's take a look at versions in conda-forge and PyPi:
Conda Forge
PyPi
Both are actually up to date. So the problem here isn't as much the channels but conda mixing up the reference for the labels.
Update conda with
conda update
This will actually spew out a message telling you to run the command with a prefix for the proper path for your environment. Should be something like this:
conda update --prefix C:\Users\yourAccount\AppData\Local\Continuum\anaconda3 anaconda
Run that and it will update packages as well, including beautifulsoup4.
After this, you'll notice that creating new environment with just conda install beautifulsoup4 will return you the latest version.
Another curious thing to notice is that
There aren't distributions of 4.7 for Win-32 or Linux-32. So, if you are on either of those, updating conda won't help. You'll have to get the source code and build it yourself (if it is even 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.