我正在運(yùn)行 Google Colab 筆記本并嘗試捕獲 TPU 分析數(shù)據(jù)以在 TensorBoard 中使用,但是capture_tpu_profile在運(yùn)行我的 TensorFlow 代碼時(shí)我無法在后臺(tái)運(yùn)行。到目前為止,我嘗試在后臺(tái)運(yùn)行捕獲過程:!capture_tpu_profile --logdir=gs://<my_logdir> --tpu=$COLAB_TPU_ADDR &和!bg capture_tpu_profile --logdir=gs://<my_logdir> --tpu=$COLAB_TPU_ADDR
2 回答

皈依舞
TA貢獻(xiàn)1851條經(jīng)驗(yàn) 獲得超3個(gè)贊
原來這樣做的方法是像這樣直接從 python 啟動(dòng)進(jìn)程(我還必須將參數(shù)從--tpu
to修改--service_addr
):
import subprocess subprocess.Popen(["capture_tpu_profile","--logdir=gs://<my_logdir>", "--service_addr={}".format(os.environ['COLAB_TPU_ADDR'])])
check=True
如果失敗,則使命令引發(fā)異常。
添加回答
舉報(bào)
0/150
提交
取消