问题
I am trying to install Tensorslow on my Windows 7 64 bit computer.
I have installed Anaconda with Python 3.5.
After that I did
conda install theano
it is successfully done.conda install mingw libpython
successfully done.pip install tensorflow
Error
I am not able to install Tensorflow in the same way I installed these other packages. Am I missing something basic?
回答1:
Ok, I've updated instructions:
*Launch your Anaconda CMD as Admin
#if tensorflow virtual env has been created, remove it first
conda remove --name tensorflow --all
conda create -n tensorflow --python=3.5 anaconda
activate tensorflow
conda install spyder
conda install ipython
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
spyder
回答2:
Tensorflow on windows only works with Python 3.5 64-bit version, I don't know why doesn't work with Python > 3.5. Try this
conda create --name newEnv python=3.5
activate newEnv
(newEnv)C:> pip install tensorflow
This install Tensorflow in that particular environment. For testing run
(newEnv)C:> python
>>>import tensorflow as tf
>>>hello = tf.constant('Hello Tensorflow!')
>>>sess = tf.Session()
>>>sess.run(hello)
It should run without any error with output "Hello Tensorflow). Tested it on Windows 10 with python 3.5 64-bit and installed tensorflow 1.0.1 cpu version.
回答3:
For Windows 10 (With NVidia 840M GPU)
If you have a different GPU check here to make sure your Compute number is > 3.0. My GPU has a 5.0
Mostly following instructions from official install instructions and steps from Stack Overflow Answer
I have found most answers do not combine the full installation from a clean install.
Configure the machine first
- Download and install Anaconda from Download Anaconda-Windows Link
- Installed Anaconda as User (I did not test installing as admin)
- Download cuDNN v5.1 (Jan 20, 2017), for CUDA 8.0
- Requires entering your email address and signing up.
- Unzip this folder and add the
*/cuda/bin
folder to your %PATH%
- Install NVIDIA Cuda Version 8 for Windows 10
- Also ensure this is in your path
- Check for missing DLL: if
where MSVCP140.DLL
returns nothing you may need to either add it to the path or find it here - Open Anaconda CMD (with admin privilages)
Now install using conda and to test the installation
In Anaconda CMD (using Admin):
conda create -n tensorflow python=3.5 anaconda
activate tensorflow
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
In Python:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
Also use the code in this answer to further confirm you are using the GPU
来源:https://stackoverflow.com/questions/43315205/installing-tensorflow-with-pip-python-3-5-anaconda-in-windows