Windows下Anaconda安装 python + tensorflow GPU版

这里首先确认没有安装CPU版本,并默认已经安装了CUDA和Cudnn以及anaconda。

安装gpu版本的tensorflow

接下来需要安装GPU版本的tensorflow:

  • 打开cmd并输入:
conda create -n tensorflow pip python=3.5 
  • 继续cmd中输入:
activate tensorflow
  • 安装
pip install --ignore-installed --upgrade tensorflow-gpu -i https://pypi.tuna.tsinghua.edu.cn/simple

在gpu版本的tensorflow 版本中使用jyuter notebook

打开Anaconda Prompt:

激活tensorflow虚拟环境

activate tensorflow

在激活TensorFlow之后安装ipython和jupyter:

(tensorflow)D:>conda install ipython 
...

(tensorflow)D:>conda install jupyter 
...

安装python kernel for Tensroflow:

(tensorflow)D:>ipython kernelspec install-self –user #不要复制这个命令,user前面是两个-,这里显示不出来

输入:

jupyter notebook

此时就可以在jupyter notebook 中使用tensorflow。

原文地址:https://www.cnblogs.com/chay/p/10372014.html