简体   繁体   中英

Installing tensorflow with Pip Python 3.5 anaconda in windows

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?

在此处输入图片说明

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

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.

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

  1. Download and install Anaconda from Download Anaconda-Windows Link
    • Installed Anaconda as User (I did not test installing as admin)
  2. 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%
  3. Install NVIDIA Cuda Version 8 for Windows 10
    • Also ensure this is in your path
  4. Check for missing DLL: if where MSVCP140.DLL returns nothing you may need to either add it to the path or find it here
  5. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM