jupyterノートブックの下でのテンソルボードの使用

例: 

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

# 清除 default graph 和不断增加的节点
tf.reset_default_graph()

# logdir 改为自己机器上的合适路径
logdir = '/Users/mac/jupyter_project/log'

# 定义一个简单的计算图,实现向量加法的操作
input1 = tf.constant([1.0,2.0,3.0],name="input1")
input2 = tf.Variable(tf.random_uniform([3]),name="input2")
output = tf.add_n([input1,input2],name="add")

# 生成一个写日志的writer,并将当前的TensorFlow计算图写入日志
writer = tf.summary.FileWriter(logdir,tf.get_default_graph())
writer.close()

実行後、ターミナルを開いてログパスに移動します

cd /jupyter_project/log

私のデフォルトの現在のディレクトリは/ Users / macなので、jupyter_projectに直接移動します

ls入力すると、フォルダー内のファイルが見つかります

 anaconda仮想環境に移動し、次を入力します

python3 -m tensorboard.main --logdir=/Users/mac/jupyter_project/log

ブラウザにhttp:// localhost:6006 /と入力してテンソルボードを開きます

元の記事を16件公開 賞賛された0 訪問数447

おすすめ

転載: blog.csdn.net/weixin_43951831/article/details/105136062
おすすめ