打印helloworld
在我们安装好python virtuanlenv tensorflow后
进入虚拟环境:
.\Scripts\active
运行python,输入以下语句
>>>import tensorflow as tf
>>>message = tf.constant(‘helloworld’)
>>>with tf.Session as sess
… print(sess.run(message).decode())
回车将打印helloworld
以上代码的意思是
1.导入tensorflow
2.常量helloworld赋值给message
3.创建Session
4.利用Session的run方法打印message,
ps:decode加上后则去掉p’'标志