美文网首页
Windows(Python3.6)使用Anaconda安装Te

Windows(Python3.6)使用Anaconda安装Te

作者: 幻无名 | 来源:发表于2018-07-13 15:59 被阅读30次

Take the following steps to install TensorFlow in an Anaconda environment:

Follow the instructions on the Anaconda download site to download and install Anaconda.(成功安装了Anaconda之后,在命令行窗口顺序输入一下代码,记得以管理员身份运行)

Create a conda environment named tensorflow by invoking the following command:

C:> conda create -n tensorflow pip python=3.6 

Activate the conda environment by issuing the following command:

C:> activate tensorflow
 (tensorflow)C:>  # Your prompt should change 

Issue the appropriate command to install TensorFlow inside your conda environment. To install the CPU-only version of TensorFlow, enter the following command:

(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow 

To install the GPU version of TensorFlow, enter the following command (on a single line):

(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow-gpu 

验证是否安装成功:
在命令行输入

python

启动Python
接着输入

>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))

如果输出:

Hello, TensorFlow!

那么安装成功!

相关文章

网友评论

      本文标题:Windows(Python3.6)使用Anaconda安装Te

      本文链接:https://www.haomeiwen.com/subject/xlfspftx.html