# 《面向机器智能的Tensor Flow实战》03 TensorFlow基础
# win10 Tensorflow-gpu1.1.0 python3.5.3
# CUDA v8.0 cudnn-8.0-windows10-x64-v5.1
# https://github.com/backstopmedia/tensorflowbook
# 原书代码(tensorflow0.8):https://github.com/backstopmedia/tensorflowbook
# filename:tfmi03.01.py # 操作(Opration)、节点(Node)、边(Edge),会话(Session),图(Graph),TensorBoard
import tensorflow as tf
a = tf.constant(5, name="input_a")
b = tf.constant(3, name="input_b")
c = tf.multiply(a, b, name="mul_c") # mul==>multiply
d = tf.add(a, b, name="add_d")
e = tf.add(c, d, name="add_e")
sess = tf.Session()
sess.run(e)
# tf.train.SummaryWriter==>tf.summary.FileWriter
writer = tf.summary.FileWriter('./tfmi', sess.graph)
writer.close()
sess.close()
# tensorboard需要使用chrome核浏览器
# tensorboard --logdir="./tfmi"
# http://localhost:6006
tensorflow46 《面向机器智能的TensorFlow实战》笔记-03-01 TensorBoard基本操作
最新推荐文章于 2020-07-08 00:26:06 发布