Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save IAmSuyogJadhav/c4e20f54aa3bc2926d93d81ccecb0036 to your computer and use it in GitHub Desktop.
Save IAmSuyogJadhav/c4e20f54aa3bc2926d93d81ccecb0036 to your computer and use it in GitHub Desktop.
Use Tensorboard on Colaboratory.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Use Tensorboard on Colaboratory.ipynb",
"version": "0.3.2",
"provenance": [],
"collapsed_sections": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/IAmSuyogJadhav/c4e20f54aa3bc2926d93d81ccecb0036/use-tensorboard-on-colaboratory.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"metadata": {
"id": "h-e3IF5bGk2G",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"# Use Tensorboard on Colaboratory\n",
"Simplest way to use tensorboard with colaboratory."
]
},
{
"metadata": {
"id": "Gi_GRPpnGv71",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"## Download ngrok"
]
},
{
"metadata": {
"id": "iAkDWN9iGaDn",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"! wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip\n",
"! unzip ngrok-stable-linux-amd64.zip"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "e8ZR_lD3GztO",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"## Start Tensorboard"
]
},
{
"metadata": {
"id": "uzSxqP-qGioM",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"LOG_DIR = '/tmp/log'\n",
"get_ipython().system_raw(\n",
" 'tensorboard --logdir {} --host 0.0.0.0 --port 6006 &'\n",
" .format(LOG_DIR)\n",
")"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "uU0h3nNJG6G2",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"## Get the public link to access Tensorboard"
]
},
{
"metadata": {
"id": "c0DIitnUGimJ",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"get_ipython().system_raw('./ngrok http 6006 &')\n",
"! curl -s http://localhost:4040/api/tunnels | python3 -c \\\n",
" \"import sys, json; print(json.load(sys.stdin)['tunnels'][0]['public_url'])\""
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "0ncNRM37HBcK",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"# Done!"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment