一 、第一个TF
python3.6
import tensorflow as tf
x=2
y=3
node1=tf.add(x,y,name='node1')
node2=tf.multiply (x,y,name='node2')
useless=tf.multiply (x,node1,name='useless')
z=tf.pow(node2,node1,name='z')
with tf.Session() as sess:
writer = tf.summary.FileWriter('./graphs',sess.graph)
print (sess.run(z))
writer.close()
终端运行:
python test.py
tensorboard --logdir="./graphs" --port 6006
浏览器打开 http://desktop-lao31jb:6006 OK可以看到TFBoard
二、数据类型
TF输入输出对接numpy