是否可以在 Colaboratory 中使用 Tensorboard。在本地运行 tensorboard 会显示有关模型行为(如损失等)的丰富信息。与 Colaboratory 合作时是否可以获得相同的信息(https://colab.research.google.com)。
问问题
5747 次
2 回答
4
您有两个选项可以使用其中一个 python 程序,该程序允许您通过隧道连接到托管您的 python 应用程序的机器实例。我测试了这个: https ://github.com/taomanwai/tensorboardcolab
!pip install -U tensorboardcolab
from tensorboardcolab import *
import shutil
#clean out the directory
shutil.rmtree('./Graph', ignore_errors=True)
os.mkdir('./Graph')
tf.reset_default_graph()
#will start the tunneling and will print out a link:
tbc=TensorBoardColab()
#**here you construct your model**
sess = tf.Session()
output = sess.run(....)
sess.close()
train_writer = tbc.get_writer();
train_writer.add_graph(sess.graph)
train_writer.flush();
tbc.close()
另一种解决方案是压缩所有文件并将它们下载到您的机器上。
于 2018-05-13T12:42:29.237 回答
1
现在您可以在 Colab 中使用 Tensorboard,而无需 ngrok 和其他软件包:
import os
logs_base_dir = "tb_runs"
os.makedirs(logs_base_dir, exist_ok=True)
%load_ext tensorboard
%tensorboard --logdir {logs_base_dir}
# Now Tensorboard interface appear in this cell output
于 2020-01-10T17:06:36.827 回答