colab中启动张量板

问题描述 投票:0回答:1

我尝试在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'])"

两天前一切正常,但现在出现了这样的错误:

error

python localhost tensorboard ngrok
1个回答
0
投票

链接的错误提示您正在使用的端口为6006,但是您在上面给出的代码示例中的端口为6060。所以可能只是一个错字。

也可能需要TCP隧道,而不是HTTP隧道。

[无论哪种情况,我都建议您尝试使用pyngrok之类的程序来以编程方式为您管理ngrok隧道吗?完全公开,我是它的开发者。 Here are the docs,如果您有兴趣。

© www.soinside.com 2019 - 2024. All rights reserved.