当我使用Google合作实验室时,如何在Google云端硬盘中保存图像和砝码? [英] When I use Google Colaboratory, how to save image, weights in my Google Drive?

查看:240
本文介绍了当我使用Google合作实验室时,如何在Google云端硬盘中保存图像和砝码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Google合作实验室,然后我想将输出图像保存在我的Google云端硬盘或SSD,HHD中,但其目录为"/content"

I use Google Colaboratory then I want to save output images in my Google Drive or SSD, HHD but its directory is "/content"

import os     
print(os.getcwd())
# "/content"

是否可以更改路径(HDD,SSD,googledrive)?

so is it possible to change path (HDD, SSD, googledrive)?

推荐答案

为减轻重量,您可以在训练后进行以下锻炼.

To save the weight you can run the following after training.

saver = tf.train.Saver()
save_path = saver.save(session, "data/dm.ckpt")
print('done saving at',save_path)

检查ckpt文件的保存位置.

Check the location where the ckpt files were saved.

import os
print( os.getcwd() )
print( os.listdir('data') )

最后下载文件!

from google.colab import files
files.download( "data/dm.ckpt.meta" ) 

这篇关于当我使用Google合作实验室时,如何在Google云端硬盘中保存图像和砝码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆