When I use Google Colaboratory, how to save image, weights in my Google Drive?

后端 未结 3 1585
执念已碎
执念已碎 2021-01-31 10:12

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())
         


        
3条回答
  •  失恋的感觉
    2021-01-31 11:05

    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)
    

    Check the location where the ckpt files were saved.

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

    Finally download the file!

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

提交回复
热议问题