问题描述
是否可以在合作实验室中使用Tensorboard.在本地运行tensorboard会显示有关模型行为(如损失等)的丰富信息.在使用Colaboratory时是否可能获得相同的信息( https: //colab.research.google.com ).
Is it possible to use Tensorboard in Colaboratory. Running tensorboard locally shows rich information about model behaviour like loss etc..is it possible get same information when working with Colaboratory(https://colab.research.google.com).
推荐答案
您有两个选择,可以使用一个python程序来允许您隧穿到托管python应用程序的计算机实例.我测试了这个: https://github.com/taomanwai/tensorboardcolab
You have two options you can use one of the python programs that allows you to tunnel to the machine instance that is hosting your python app. I tested this one: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()
另一种解决方案是压缩所有文件并将其下载到您的计算机上.
The other solution is to zip all the files and download them to your machine.
这篇关于如何在协作室中使用Tensorboard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!