Python TensorBoard事件文件未在google drive中更新

Python TensorBoard事件文件未在google drive中更新,python,tensorflow,google-drive-api,google-colaboratory,tensorflow2.0,Python,Tensorflow,Google Drive Api,Google Colaboratory,Tensorflow2.0,我使用GoogleColab来训练我的模型。我使用tensorflow 2.2 以下是我如何创建摘要编写器: writer = tf.summary.create_file_writer(os.path.join(model_dir, 'logs'), max_queue=1) 以下是我在每个步骤中运行的代码: with writer.as_default(): tf.summary.scalar("train_loss", total_loss, step=num

我使用GoogleColab来训练我的模型。我使用tensorflow 2.2

以下是我如何创建摘要编写器:

writer = tf.summary.create_file_writer(os.path.join(model_dir, 'logs'), max_queue=1)
以下是我在每个步骤中运行的代码:

with writer.as_default():
    tf.summary.scalar("train_loss", total_loss, step=num_steps)
    writer.flush()
问题是,如果model_dir只是/content/model_dir,那么一切都可以保存,但是如果我将我的模型保存到google drive上的文件夹中(我使用以下代码连接到google drive):

from google.colab import drive
drive.mount('/content/gdrive2', force_remount=True)
)然后事件文件不会得到更新。它正在创建中,但在培训期间(甚至在培训结束后)没有填充数据


据我所知,问题在于google drive不理解tensorflow会更新事件文件。但训练结束后,整个事件文件将被保存。如何修复此错误?

我已经多次遇到此问题,但仍然不知道是什么原因导致此问题。对我来说,要么事件文件“似乎”没有更新,要么它们“似乎”根本没有被创建。有时会发生,但其他时候不会。一个偶然的机会,我想出了一个绕过它的办法。只需下载目录,文件就会显示在下载的zip文件中。因此,我将问题描述为“似乎”。我认为Google Drive可以很好地理解TensorFlow会更新事件文件,但有时会因为某些原因导致文件无法正常显示。好的,谢谢您的帮助!