Tensorflow works fantastic on Windows, with our without GPU acceleration. Unfortunately, if you follow the instructions on the Tensorflow website you will probably be pretty confused – because they are incorrect.
The official installation instructions as of now tell you to do the following to install on Anaconda on Windows:
1 2 3 4 5 |
conda create -n tensorflow activate tensorflow pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-win_amd64.whl |
Which will then probably result in the following python error:
tensorflow-1.1.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
This is because Google has only published Tensorflow packages for Windows that target Python 3.5. Python 3.6 has been the default for Anaconda for quite some time now.
You can take a look at the published packages at https://pypi.python.org/pypi/tensorflow
You’ll notice that while a variety of Python versions are targetted for other platforms, Windows only supports 3.5.
So the fix is pretty easy – Just tell Anaconda to create you a Python 3.5 environment for Tensorflow instead of a 3.6 environment.
1 |
conda create -n tensorflow python=3.5 anaconda |
then proceed with the official instructions
1 2 3 4 5 6 7 |
activate tensorflow # For CPU pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-win_amd64.whl # Or for GPU pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.1.0-cp35-cp35m-win_amd64.whl |
If you need to clean up your old Anaconda environments use
1 |
conda remove --name [environment name] --all |
Note that these instructions have been fixed in the TF repo, but are not reflected on the site yet.
Thanks a lot!.
I have just corrected my tensorflow previous installation.
After removing old environment tensorflow I have created the new env. then the pip install with GPU has worked fine and quick!.
The validate python tensorflow “hello” script is working again.