【问题标题】:Running cloud TPU profiler in Google Colab environment在 Google Colab 环境中运行云 TPU 分析器
【发布时间】:2019-04-14 16:41:33
【问题描述】:

我正在运行 Google Colab 笔记本并尝试捕获 TPU 分析数据以在 TensorBoard 中使用,但是在运行我的 TensorFlow 代码时我无法让 capture_tpu_profile 在后台运行。

到目前为止,我尝试在后台运行捕获过程:

!capture_tpu_profile --logdir=gs://<my_logdir> --tpu=$COLAB_TPU_ADDR &

!bg capture_tpu_profile --logdir=gs://<my_logdir> --tpu=$COLAB_TPU_ADDR

【问题讨论】:

    标签: python tensorflow google-colaboratory google-cloud-tpu


    【解决方案1】:

    原来的方式来做到这一点是开始从蟒直接像这样的方法(Ⅰ也不得不修改从--tpu参数到--service_addr):

    import subprocess
    subprocess.Popen(["capture_tpu_profile","--logdir=gs://<my_logdir>", "--service_addr={}".format(os.environ['COLAB_TPU_ADDR'])])
    

    check=True使命令在失败时引发异常。

    【讨论】:

    • 这实际上在谷歌思加主义上为您工作吗?我一直在尝试一切,我无法搞定。它只是没有捕获任何数据,尤其是事件文件为空等(例如,文件名将以“.profile-empty”结束) spp>
    • 它对我不起作用。 LogDir需要Google存储桶,并为写入日志文件的TPU Pod提供正确的访问权限。完成此操作后,将激活日志记录,但它不会异步运行,即,您无法同时运行Profiler和Model。如果您运行“!capture_tpu_profile - monitoring_level 2 --tpu $ tpu_name”,profiler运行。问题是让它在后台运行。 span>
    【解决方案2】:
    猜你喜欢
    • 2020-10-01
    • 2019-12-06
    • 2021-02-17
    • 1970-01-01
    • 2020-07-05
    • 2020-09-11
    • 2021-12-20
    • 2021-02-20
    • 2019-04-01
    相关资源
    最近更新 更多