我正在运行 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
                    
                    
                2 回答
                            皈依舞
                            
                                
                            
                        
                        
                                                
                    TA贡献1851条经验 获得超3个赞
原来这样做的方法是像这样直接从 python 启动进程(我还必须将参数从--tputo修改--service_addr):
import subprocess
subprocess.Popen(["capture_tpu_profile","--logdir=gs://<my_logdir>", "--service_addr={}".format(os.environ['COLAB_TPU_ADDR'])])check=True如果失败,则使命令引发异常。
添加回答
举报
0/150
	提交
		取消
	