Install Tensorflow and Keras in Windows 10

Modify PIP source referenceUse Python PIP as an example

Official document Config file

All Windows users need to be in %APPDATA%\ PIP \pip.ini, the current user in %HOME%\ PIP \pip.ini

[global]
index-url=http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.comCopy the code

Install Tensorflow

See Installing TensorFlow on Windows

# switch to python3.5 reference See another blog https://anjia.ml/2017/07/02/anaconda-install-and-configurating-jupyter/# switch python version Anaconda Prompt (python35) C:\Users\xx> activate python35 C:\Users\xx> PIP install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp35-cp35m-win_amd64.whl (python35) C:\Users\xx>pythonCopy the code
>>> import tensorflow as tf >>> hello = tf.constant('Hello, TensorFlow') >>> sess = tf.session () 2017-07-03 16:44:16.082952: W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, The largest CPU segments consists of the largest segments. The largest CPU segments consists of the largest segments. W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, The largest CPU segments consists of the largest segments. The largest CPU segments consists of the largest segments. W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, The largest COMPUtations each goes to the largest CPU each time. W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow Library compiled to use SSE4.1 instructions The largest CPU segments consists of the largest segments. The largest SEGMENTS consists of the largest segments. W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library compiled to use SSE4.2 instructions The largest COMPUtations each goes to the largest CPU each time. W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, The largest COMPUtations goes to the largest one each. These are available on your machine and could speed up. W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, The largest CPU segments consists of the largest segments. Each of these segments consists of the largest segments. W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. >>> print(sess.run(hello)) b'Hello, TensorFlow'Copy the code

If you want to remove the 4-12 warning, you need to compile it yourself. See “The TensorFlow Library wasn’t compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations” in “Hello, TensorFlow!” program #7778

Install Keras

Keras Installation and Configuration Guide (Windows)

(python35) C:\Users\xx>pip install keras -U --preCopy the code

But I keep getting errors in my installation,

Running setup.py bdist_wheel for scipy ... error
  Complete output from command {Anaconda3_home}\envs\python35\python.exe -u -c "import setuptools, tokenize; __file__='{AppData}\\Local\\Temp\\pip-build-mgdjtt1d\\scipy\\setup.py'; f=getattr(tokenize, 'open', open)(__file__); code=f.read().replace('\r\n', '\n'); f.close(); exec(compile(code, __file__, 'exec'))" bdist_wheel -d {AppData}\Local\Temp\tmpb_od_dlvpip-wheel- --python-tag cp35:
  lapack_opt_info:
  lapack_mkl_info:
    libraries mkl_rt not found in ['{Anaconda3_home}\\envs\\python35\\lib'.'C:\\'.'{Anaconda3_home}\\envs\\python35\\libs']
    NOT AVAILABLE

## ...

Command "{Anaconda3_home}\envs\python35\python.exe -u -c "import setuptools, tokenize; __file__='{AppData}\\Local\\Temp\\pip-build-mgdjtt1d\\scipy\\setup.py'; f=getattr(tokenize,'open', open)(__file__); code=f.read().replace('\r\n'.'\n'); f.close();exec(compile(code, __file__, 'exec'))" install --record {AppData}\Local\Temp\pip-htcraop7-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in {AppData}\Local\Temp\pip-build-mgdjtt1d\scipy\Copy the code

There are Suggestions through PIP install git+git://github.com/Theano/Theano.git out directly installed the latest code, but also install failed

The way I succeed

(python35) C:\Users\xx>conda install mingw libpython theano -y
(python35) C:\Users\xx>pip install kerasCopy the code

China network is not stable, quite slow, can refer to another blog switch tsinghua source anjia.ml/2017/07/02/…

(python35) C: \ Users \ xx > python 3.5.3 | Continuum Analytics, Inc. | (default, May 15, 2017, 10:43:23) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import keras Using TensorFlow backend.Copy the code

The installation is successful. The default backend is TensorFlow

Blog anjia. Ml / 2017/07/03 /… The nuggets juejin. Cn/post / 684490… Jane books www.jianshu.com/p/e0d9fa795…