Switching from tensorflow on python 3.6 to python 3.5 - python

This is my first question on stackoverflow, please bear with me as I will do my best to provide as much info as possible.
I have a windows 10, 6-bit processor. My end goal is to use keras within spyder. The first thing I did was update python to 3.6 and install tensorflow, which seemed to work. When I attempted to get keras, however, it wasn't working, and I read that keras worked on python 3.5. I successfully installed keras on python 3.5, which automatically installed theano as the backend.
But now I have two spyder environments, one running off of python 3.5, one off of 3.6. The 3.5 reads keras but doesn't go through with any modules because it cannot find tensorflow. The 3.6 can read tensorflow, but cannot find keras.
Please let me know what you would recommend. Thank you!

Create a virtualenv with python 3.5 installed.
I dealt with this same issue, using Jupyter Notebook. Didn't understand why you would even need a virtualenv until I learned from this roadblock.
Full details on installing and setting up a virtualenv can be found here:
http://pymote.readthedocs.io/en/latest/install/windows_virtualenv.html

Odd, the installation instructions say that TF only supports Python 3.5 on Windows. I would uninstall TF with pip uninstall tensorflow (if you installed it with pip to begin with) using pip from your Python 3.6 path, then re-install (pip install --upgrade tensorflow) making sure that you are running pip from your Python 3.5 path.

I had some issues with my tensorflow's installation too.
I personnaly used anaconda to solve the problem.
After installing anaconda (Maybe uninstall the old one if you already have one), launch an anaconda prompt and input conda create -n tensorflow python=3.5, afther that, you must activate it with activate tensorflow.
Once it's done, you have to install tensorflow on your python 3.5.
For that, use:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.0rc1-cp35-cp35m-win_amd64.whl
for cpu version
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.2.0rc1-cp35-cp35m-win_amd64.whl for gpu version
You now have the r1.2 version of tensorflow.
Then, just use pip install keras and keras will be installed.
Now, all you have to do is launch anaconda navigator, select tensorflow on the scrolling menu and launch spyder/jupyter.
You can now use Keras with a tensorflow backend in Python 3.5
Hope it helped someone ! (It take me so much time to find it by myself)

Related

installing tensorflow 1.x to use tensorflow.contrib

I downloaded anaconda which has a python 3.8 version. and i installed tensorflow with pip install tensorflow.
from tensorflow.contrib import learn in my code did not work as tensorflow 1.x doesnt work in python 3.8.
I downgraded to python 3.7 by conda install python==3.7. and then pip install tensorflow==1.15. But it still did not work and errors came up -- regarding python version still being 3.8 inside python.exe.
How can I go about it? Is there an alternate way to install? Please help. Thank you
You can download tensorflow1.X from https://pypi.org/
For example tensorflow1.15.0. Select the whl file corresponding to your system.
Then use pip install path/tensorflow-1.15.0-XXXX.whl or
conda install path/tensorflow-1.15.0-XXXX.whl to install.

tensorflow 1.4 needed on Jupyter Notebook (Python)

I need an installation of old Tensorflow 1.4.x on my Jupyter Notebook, but I was not able to find an old source.
So I tried to install the latest version and then to migrate my Python scripts using the converter of the Tensorflow homepage. It did not work.
Also changing the behaviour of the TF 2.x to act as 1.x in the import statement of the .py scripts did not work - as often suggested here on stackoverflow.
So I really need an installation of TF 1.4.x
Any clue how to do that?
Thanks
Select a specific version of tensorflow from those available here. Then you can download the required specific .whl file and install that.
python -m pip install tensorflow-1.14.0-cp37-cp37m-win_amd64.whl
Optionally, you should be able to install with:
python -m pip install tensorflow==1.14.0
or
python -m pip install tensorflow==1.15.5
As long as there's a version available for Python version you're on. Ex. The 1.14.0 version is not available for Python 2.7, but it is available for 3.7.

tensorflow installation in python 3.9.0(64 bit) and pip version 20.2.3 .?

I want to install TensorFlow, I have tried everything from reinstalling everything to trying different versions it doesn't help.
I have tried it with python 3.9.0 and pip version 20.0.3
Currently (1st of March, 2021), there is no official stable tensorflow version for the latest stable python 3.9.
However, nightly version of tensorflow supports python 3.9.
Simply pip install tf-nightly-gpu or pip install tf-nightly
Note, the library name is the same, e.g. importing works as import tensorflow as tf without any problems. This means you will not have to update your code once official support is added and you've migrated to the stable version.
The Official TensorFlow website specifies python 3.5-3.8.
You need to create a new environment as suggested in the previous answer with a new version of python, or uninstall python 3.9 and install other version. I use python 3.6.8 for Tensorflow and it works great.
I had the similar problem but I am able to resolve it by downloading the python version 3.8.6 and installing it. Please pay attention to add the python and the respective pip path in the environment.
Then give the command, which will install tensorflow version 2.3.1
pip install tensorflow
You may upgrade the pip by following command,
py -m pip install --upgrade pip
I hope that it works for you.

How to install Tensorflow and Keras library on windows 10 home edition?

Please guide me the steps and source to install Tensorflow and keras on Windows 10 home edition using python (pip)?
Try the following at command prompt:
pip install --upgrade tensorflow
pip install --upgrade keras
Also, refer the following link for more detail:
https://www.tensorflow.org/install/pip
I had many issues installing tensorflow and keras by using: pip install...
I would suggest to you Anaconda.navigator. Although It is slower than Anaconda prompt, it helped me to understand the installation process. It worked for me.
First, I uninstalled old versions of Python and Anaconda and Installed Anaconda for Python 3.7 from here (Anaconda3-2019.10-Windows-x86_64.exe) (At this time Tensorflow and keras do not support Python 3.8).
In the Anaconda.Navigator I went to "environments" select "create" (create new environment) and name it. Then, on your new environment select what ever you want to install (tensorflow, tensorflow-gpu, keras, keras-gpu). Make sure that Python lower than 3.8 is on your new environment. This video1 and video2 may help you.
I hope you solve your problem.

How do you install Tensorflow on Windows?

I am trying to install Tensorflow on Windows.
I have Anaconda 4.2.0. I tried running
conda create -n tensorflow python=3.5
in my command prompt. This seemed to do something, but I'm not sure what this accomplished. It created a folder within the Anaconda3 program in my username folder.
This folder is filled with the following content:
Over the summer, I used mainly Jupyter Notebooks to do my python coding. Within this environment, there is a tab marked Condas
So it looks like I should be able to switch to the Tensorflow environment. But this doesn't work when I try to switch, there is no option to change my kernel to a Tensorflow one.
I tried running
conda search tensorflow
But nothing appears.
I'm not sure what to do. I asked a few grad students in my economics research group, but they weren't sure what to do either.
My Question
How do I properly install Tensorflow on Windows?
The syntax of the command is conda create -n <name_of_new_env> <packages>. As a result, you created a clean environment named tensorflow with only Python 3.5 installed. Since conda search tensorflow returned nothing, you will have to use pip or some other method of installing the package. Since there is spotty official support for Windows, the conda-forge package (CPU only) at https://github.com/conda-forge/tensorflow-feedstock is probably the best way.
People have also reported success installing Tensorflow with docker, if you have docker set up already.
I was able to run it under the Windows 10 linux subsystem (https://msdn.microsoft.com/en-us/commandline/wsl/install_guide)
Which is basically a linux environment within windows.
The latest tensorflow version (0.12) added windows support
https://www.tensorflow.org/get_started/os_setup#pip_installation_on_windows
just run:
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.1-cp35-cp35m-win_amd64.whl
(the url is for the specific version - you will need to change it for future versions or other setups)
An Anaconda environment isolates itself completely with the outer world, so all the packages you installed outside the virtualenv is nothing in the virtualenv, if you want to use Tensorflow in the environment(seems like the only way with Anaconda), use activate tensorflow command and install the packages you want seperately.
pip provides an easy method to install tensorflow on windows machine.
use the following pip command
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
Tensorflow only support python3.5 x64 bit on windows machines and it requires that you install Visual C++ 2015 redistributable (x64 version) to be able to import tensorflow

Categories

Resources