- 运行下列命令进行安装配置
conda create -n tensorflow python=3.5
source activate tensorflow
conda install pandas matplotlib jupyter notebook scipy scikit-learn
conda install -c conda-forge tensorflow
- 测试安装是否成功
在 Python console 下运行下列代码,检测 TensorFlow 是否正确安装。
import tensorflow as tf
# Create TensorFlow object called tensor
hello_constant = tf.constant('Hello World!')
with tf.Session() as sess:
# Run the tf.constant operation in the session
output = sess.run(hello_constant)
print(output)
如果安装正确,Console 会打印出 "Hello, world!"。
test tensorflow
网友评论