How to reduce tensor flow, maybe several versions?

I have tensorflow 1.2.1 installed and I need to downgrade it to version 1.1 in order to run a specific tutorial. What is the safe way to do this? I am using Windows 10, python 3.5. Tensorflow was installed with pip3, but "pip3 show tensorflow" returns empty.

Is it possible to have several versions of tensor flow on the same OS?

+10
source share
5 answers

Pip allows you to specify the version

pip install tensorflow==1.1

+18
source

Can I have multiple versions of tenorflow on the same OS?

Yes, you can use Python virtual environments to do this. From the docs :

A virtual environment is a tool for storing the dependencies needed by various projects in different places, creating virtual Python environments for them. It solves the problem "Project X depends on version 1.x, but Project Y requires 4.x" and keeps your global site-packages directory clean and manageable.

After you installed virtualenv (see the Documentation ), you can create a virtual environment for the tutorial and install the version of tenorflow 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 indicate where Python is installed on your system. When you want to use another version of tenorflow, do:

 deactivate my_tutorial_env 

Now you can work again with the version of tenorflow that has already been installed on your system.

+5
source

I discovered the joy of the anaconda: https://www.continuum.io/downloads

 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 creates a virtual environment.

+5
source

If you use python3 for windows, you can also do this

pip3 install tensorflow==1.4

you can choose 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

+2
source

You can try using the --no-cache-dir options along with -I to overwrite the cache of the previous version and install the new version. For instance:

 pip3 install --no-cache-dir -I tensorflow==1.1 

Then use the following command to check the version of tenorflow:

 python3 -c 'import tensorflow as tf; print(tf.__version__) 

This should show the correct version that was installed.

0
source

Source: https://habr.com/ru/post/1270985/


All Articles