为什么 Tensorboard 使用 rsync 时不刷新?

Why does Tensorboard not refresh when used with rsync?

我正在 运行 在远程机器上进行 tensorflow 实验,不断写入同一个 events.out.tfevents.xxx 文件。我希望张量板每分钟左右自动刷新一次以显示新日志。当使用 sshfs 在我的笔记本电脑上安装远程机器并将安装的目录用于 运行 tensorboard on.

时,这确实有效

但是,当使用 rsync 将文件复制过来并 运行 本地文件上的 tensorboard 时,tensorboard 永远不会刷新,我必须重新启动它才能获得更新。

这是我的 rsync 命令:

rsync -aP --del -e ssh server_name:folder_on_server local_folder --exclude='*checkpoints*' --exclude='*.json' --exclude='*.DS_Store'

如有任何帮助,我们将不胜感激!

这是 Tensorboard 的一个已知问题,请参阅 issue github。

引用该问题(重点是我的):

It looks like when the tensorboard reads an event file from local directory - it will not notice that the event file was deleted and recreated (which is quite valid case when you are using [...] rsync to sync the data)

一种解决方法是在 rsync 命令中使用 --inplace 作为选项。