google colaboratory, weight download (export saved models)

后端 未结 7 1734
执念已碎
执念已碎 2021-01-30 14:36

I created a model using Keras library and saved the model as .json and its weights with .h5 extension. How can I download this onto my local machine?

to save the model I

7条回答
  •  故里飘歌
    2021-01-30 15:27

    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)
    

    Then check the location where the ckpt files were saved.

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

    Finally download the files with weight!

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

提交回复
热议问题