我正在尝试使用Google colab运行Tensorflow DCGAN教程。代码正在运行,培训正在运行,正在显示的图像正在更改,但是我无法将其保存到Google驱动器中!
from google.colab import drive
drive.mount('/content/gdrive')
root_path = 'gdrive/My Drive/Colab Notebooks/Final Project/'
我可以从我的Google驱动器中读取文件甚至解压缩kaggle数据集 但是当我尝试使用matplotlib保存图像时 它不会创建图像
plt.savefig('/content/gdrive/My Drive/Colab Notebooks/FinalProject/result/image_at_epoch_{:04d}.png'.format(epoch))
plt.show()
我在保存检查点时也遇到了麻烦
checkpoint_dir = './content/gdrive/My Drive/Colab Notebooks/FinalProject/training_checkpoints'
checkpoint_prefix = os.path.join(checkpoint_dir, "ckpt")
checkpoint = tf.train.Checkpoint(generator_optimizer=generator_optimizer, discriminator_optimizer=discriminator_optimizer, generator=generator, discriminator=discriminator)
有人知道我在做什么错吗?