Skip to content

Instantly share code, notes, and snippets.

@codeperfectplus
Created April 28, 2021 06:16
Show Gist options
  • Save codeperfectplus/68c12dd23973e350ab3592b2ed175cc2 to your computer and use it in GitHub Desktop.
Save codeperfectplus/68c12dd23973e350ab3592b2ed175cc2 to your computer and use it in GitHub Desktop.
run tensorboard on colab
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Untitled9.ipynb",
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "code",
"metadata": {
"id": "Lhr4il6SHjvM"
},
"source": [
"!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip\n",
"!unzip -o ngrok-stable-linux-amd64.zip"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "LZdOiIQHHk3f"
},
"source": [
"LOG_DIR = model_dir\n",
"get_ipython().system_raw(\n",
" 'tensorboard --logdir {} --host 0.0.0.0 --port 6006 &'\n",
" .format(LOG_DIR))"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "Nkem7UsaHk5m"
},
"source": [
"get_ipython().system_raw('./ngrok http 6006 &')"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "lHUQqhyBHk9B"
},
"source": [
"!curl -s http://localhost:4040/api/tunnels | python3 -c \\\n",
" \"import sys, json; print(json.load(sys.stdin)['tunnels'][0]['public_url'])\""
],
"execution_count": null,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment