Is there any way to use Tensorboard when training a Tensorflow model on Google Colab ?
相关问题
- batch_dot with variable batch size in Keras
- How to use Reshape keras layer with two None dimen
- CV2 Image Error: error: (-215:Assertion failed) !s
- Why keras use “call” instead of __call__?
- How to conditionally scale values in Keras Lambda
相关文章
- tensorflow 神经网络 训练集准确度远高于验证集和测试集准确度?
- Tensorflow: device CUDA:0 not supported by XLA ser
- Numpy array to TFrecord
- conditional graph in tensorflow and for loop that
- How to downgrade to cuda 10.0 in arch linux?
- Apply TensorFlow Transform to transform/scale feat
- How to force tensorflow tensors to be symmetric?
- keras model subclassing examples
Here's an easier way to do the same ngrok tunneling method on Google Colab.
then,
Assuming you are using Keras:
You can read the original post here.
I make use of google drive's back-up and sync https://www.google.com/drive/download/backup-and-sync/. The event files, which are prediodically saved in my google drive during training, are automatically synchronised to a folder on my own computer. Let's call this folder
sync_folder
. To access the visualizations in tensorboard I open the command prompt and type:tensorboard --logdir=sync_folder
.So, by automatically syncing my drive with my computer (using back-up and sync), I can use tensorboard as if I was training on my own computer.
I currently use ngrok to tunnel traffic to localhost.
A colab example can be found here.
These are the steps (the code snippets represent cells of type "code" in colab):
Get TensorBoard running in the background.
Inspired by this answer.
Download and unzip ngrok.
Replace the link passed to
wget
with the correct download link for your OS.Launch ngrok background process...
...and retrieve public url. Source
Here is how you can display your models inline on Google Colab. Below is a very simple example that displays a placeholder:
Currently, you cannot run a Tensorboard service on Google Colab the way you run it locally. Also, you cannot export your entire log to your Drive via something like
summary_writer = tf.summary.FileWriter('./logs', graph_def=sess.graph_def)
so that you could then download it and look at it locally.TensorBoard for TensorFlow running on Google Colab using tensorboardcolab. This uses ngrok internally for tunnelling.
!pip install tensorboardcolab
tbc = TensorBoardColab()
This automatically creates a TensorBoard link that can be used. This Tensorboard is reading the data at './Graph'
summary_writer = tbc.get_writer()
tensorboardcolab library has the method that returns FileWriter object pointing to above './Graph' location.
You can add scalar info or graph or histogram data.
Reference: https://github.com/taomanwai/tensorboardcolab