DCGAN-tensorflow icon indicating copy to clipboard operation
DCGAN-tensorflow copied to clipboard

How to save discriminator network?

Open 0buo opened this issue 5 years ago • 2 comments

In the frozen graph, there seems to be only the generator when I print out all the ops. Is there a way to save the discriminator model as well?

0buo avatar Nov 24 '20 01:11 0buo

Hey, man, have you solved this problem

Whatsetsthisend avatar Dec 01 '20 05:12 Whatsetsthisend

you can save any model using JSON and save weights here script code to save any model `

from keras.models import model_from_json

model_json = discriminator.to_json()
with open("/PATH/discriminator.json", "w") as json_file:
    json_file.write(model_json)

discriminator.save_weights("/PATH/discriminator.h5")
print("Saved model to disk")

`

then you can reuse it after load it

ref. https://machinelearningmastery.com/save-load-keras-deep-learning-models/

imnawar avatar Feb 25 '21 11:02 imnawar