ttensorflow 入门之一 - tensorflow 入门简单案例
安装 tensorflow 1.14
pip install tensorflow==1.14
或
conda install tensorflow==1.14
import tensorflow as tf
tf.__version__
'1.14.0'
这里我用的 tensorflow 版本是 1.14
message=tf.constant("hello tensorflow")
constant 是 tensorflow 中的用来保存常量的数据结构
with tf.Session() as sc:
print(sc.run(message))
b'hello tensorflow'
tf.Session() 类似于创建一个任务, 之后通过其 run 方法运行我们编写的任务 message