Install TensorFlow with Anaconda

This article illustrates how to install TensorFlow with Anaconda and how to configure the TensorFlow environment for Spyder.

Step1:

install anaconda

Step2:

run anaconda prompt as administrator

Step3:

In the command window, type the following:

conda create -n tensorflow pip python=3.6

Step4:

To enter into the TensorFlow environment, enter the following:

activate tensorflow

Step5:

Install the CPU version of Tensorflow:

pip install --ignore-installed --upgrade tensorflow

Step6:

Test

  1. To activate tensorflow, enter activate tensorflow You will see (tensorflow) at the beginning of your command
  2. run python

enter the following code to run your first TF program:

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

The output should be like this:

Step7:

configure tensorflow environment for spyder

Step8:

Launch the Jupyter or Spyder in the tensorflow environment.

test the environment

Done!

:)


推薦閱讀:

安裝Anaconda後,Unable to import pyautogui #Python#VSCode
深度學習的工具箱系列2:Anaconda介紹
如何在多版本anaconda python環境下轉換spyder?
windows安裝anaconda 報錯failed to create anacoda menue?
在看spark大數據分析的時候,輸入書中的範例代碼卻提示缺少參數,怎麼辦呢?

TAG:TensorFlow | Anaconda |