在 Google Colab 环境中运行云 TPU 分析器

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

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

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

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


手掌心
浏览 193回答 2
2回答

皈依舞

原来这样做的方法是像这样直接从 python 启动进程(我还必须将参数从--tputo修改--service_addr):import&nbsp;subprocess subprocess.Popen(["capture_tpu_profile","--logdir=gs://<my_logdir>",&nbsp;"--service_addr={}".format(os.environ['COLAB_TPU_ADDR'])])check=True如果失败,则使命令引发异常。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python