我尝试在colab上启动tensorboard,我的代码:
LOG_DIR = model_dir
get_ipython().system_raw(
'tensorboard --logdir {} --host 0.0.0.0 --port 6060 &'
.format(LOG_DIR)
)
get_ipython().system_raw('./ngrok http 6060 &')
! curl -s http://localhost:4040/api/tunnels | python3 -c \
"import sys, json; print(json.load(sys.stdin)['tunnels'][0]['public_url'])"
两天前一切正常,但现在出现了这样的错误:
链接的错误提示您正在使用的端口为6006
,但是您在上面给出的代码示例中的端口为6060
。所以可能只是一个错字。
也可能需要TCP隧道,而不是HTTP隧道。
[无论哪种情况,我都建议您尝试使用pyngrok
之类的程序来以编程方式为您管理ngrok
隧道吗?完全公开,我是它的开发者。 Here are the docs,如果您有兴趣。