首页 > 解决方案 > TensorFlow 1 中的 TensorBoard 使用 Google Colab

问题描述

我想在 Google Colab 的 TensorFlow 1 中使用 TensorBoard。我发现的教程似乎在 TensorFlow 2 上,而这些建议似乎在 TensorFlow 1 中不起作用。

看来我需要一些等效于 tf.summary.create_file_writer 和 tf.summary.scalar。我已经尝试过 tf.contrib.summary.create_file_writer 和 tf.contrib.summary.scalar,但这些似乎不起作用。

这是我的问题的娱乐:

https://colab.research.google.com/drive/1M3CL0oasd8pCjXLaaHl15I1yz-LUXNhq

标签: pythontensorflowjupyter-notebookgoogle-colaboratorytensorboard

解决方案


!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
!unzip ngrok-stable-linux-amd64.zip

get_ipython().system_raw('tensorboard --logdir /content/trainingdata/objectdetection/ckpt_output/trainingImatges/ --host 0.0.0.0 --port 6006 &')

get_ipython().system_raw('./ngrok http 6006 &')

! curl -s http://localhost:4040/api/tunnels | python3 -c \
 "import sys, json; print(json.load(sys.stdin)['tunnels'][0]['public_url'])"

这为您提供了来自创建的日志文件的张量板。它适用于 TF1.13


推荐阅读