Open dawncc opened 7 years ago
目前tensorflow对python3.5支持友好
conda create --name tensorflow python=3.5
activate tensorflow
-- CPU版本
pip install tensorflow
-- GPU版本
pip install tensorflow-gpu
不安装CUDA Driver会出现如下错误:
ImportError: No module named '_pywrap_tensorflow_internal'
注意:需要下载5.1版本,6.0版本不可用
Cudnn解压后将bin,include,lib三个文件夹里面的内容覆盖至Cuda安装目录下,默认路径为C:\Program Files\NVIDIA GPUComputing Toolkit\CUDA\v8.0(记住不是替换,是把Cudnn文件里的.dll文件添加到Cuda里面)
接下来,检验Cuda是否安装成功: 进入cuda路径,默认C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\extras\demo_suite执行里面的deviceQuery.exe文件
conda install matplotlib
Anaconda上查看
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
a = tf.random_normal([2, 20])
sess = tf.Session()
out = sess.run(a)
x, y = out
plt.scatter(x,y)
plt.show()
Anaconda
Anaconda是由Python提供支持的领先的开放数据科学平台。 Anaconda的开源版本是Python和R的高性能分发版本,包括超过100个用于数据科学的最流行的Python,R和Scala软件包。
操作说明:
1. Managing conda
2. Managing environments
Create and activate an environment
This will create a new environment named /envs/snowflakes with the program Biopython.
Activate the new environment:
Linux,OS X:
source activate snowflakes
Windows:
activate snowflakes
Create a second environment
This will create a second new environment named /envs/bunnies with Python 3 and Astroid and Babel installed.
List all environments
Switch to another environment (activate/deactivate)
Linux,OS X:
source activate bunnies
Windows:
activate bunnies
3. Managing Python
Check Python versions
Install a different version of Python
Linux,OS X:
source activate snowflakes
Windows:
activate snowflakes
4. Managing packages
View a list of packages and versions installed in an environment
Search for a package
Install a new package
Install a package from Anaconda.org
Install a package with pip