打開Anaconda Prompt
創建一個tensorflow 虛擬環境:
conda create -n tensorflow python=3.6
激活tensorflow虛擬環境
activate tensorflow
查找當前可用的tensorflow包
anaconda search -t conda tensorflow
根據提示,查看一個包的詳情信息
anaconda show anaconda/tensorflow
根據提示,copy命令安裝tensorflow
conda install –channel https://conda.anaconda.org/anaconda tensorflow
查看環境,確認安裝是否成功
conda info –envs
也可以測試一下
python
import tensorflow as tf
hello = tf.constant("Hello tensorflow!")
session = tf.Session()
print(session.run(hello))
至此,完成了tensorTensorFlow的安裝,但是要在jupyter notebook中用的話還需要下面的操作
jupyter中使用TensorFlow
在激活TensorFlow之后安裝ipython和jupyter
(tensorflow)D:>conda install ipython
···
(tensorflow)D:>conda install jupyter
···
打開Jupyter notebook
試試 import tensorflow as tf
來源:CSDN
原文:https://blog.csdn.net/weixin_41043240/article/details/79519118