1.安装anaconda 4.2.0
2.安装tensorflow(在anaconda Prompt中进行)
输入pip install tensorflow会自动安装
3.检查是否成功安装
①在jupyter Notebook中进行
没有成功安装
import tensorflow as tf
成功安装测试代码(2.1版本以上)
import tensorflow as tf tf.compat.v1.disable_eager_execution() hello = tf.constant("hello,tensorflow") sess= tf.compat.v1.Session() print(sess.run(hello))
测试结果
②显示tensorflow版本
import tensorflow as tf tf.__version__