Last active
September 28, 2021 13:22
-
-
Save adhadse/ba06a60b4a5f63cb165aa98d5c38e47f to your computer and use it in GitHub Desktop.
Script to run TensorBoard on Kaggle. Enable internet for the kernel.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import multiprocessing | |
# Clear any logs from previous runs | |
!rm -rf ./logs/ | |
!mkdir ./logs/ | |
!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip | |
!unzip ngrok-stable-linux-amd64.zip | |
pool = multiprocessing.Pool(processes = 10) | |
results_of_processes = [pool.apply_async(os.system, args=(cmd, ), callback = None ) | |
for cmd in [ | |
f"tensorboard --logdir ./logs/ --host 0.0.0.0 --port 6006 &", | |
"./ngrok http 6006 &" | |
]] | |
! curl -s http://localhost:4040/api/tunnels | python3 -c \ | |
"import sys, json; print(json.load(sys.stdin)['tunnels'][0]['public_url'])" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment