google colaboratory, weight download (export saved models)

后端 未结 7 1846
执念已碎
执念已碎 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:09

    To download the model to the local system, the following code would work- Downloading json file:

    model_json = model.to_json()
    with open("model1.json","w") as json_file:
         json_file.write(model_jason)
    
    files.download("model1.json")
    

    Downloading weights:

    model.save('weights.h5')
    files.download('weights.h5')
    

提交回复
热议问题