Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to save discriminator network? #388

Open
0buo opened this issue Nov 24, 2020 · 2 comments
Open

How to save discriminator network? #388

0buo opened this issue Nov 24, 2020 · 2 comments

Comments

@0buo
Copy link

0buo commented Nov 24, 2020

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?

@Whatsetsthisend
Copy link

Hey, man, have you solved this problem

@imnawar
Copy link

imnawar commented Feb 25, 2021

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants