Saving a model in Keras requires just one line of code. To save the generator model, add the following line:
# Specify the path for the generator model
unet_generator.save_weights("generator.h5")
Similarly, save the discriminator model by adding the following line:
# Specify the path for the discriminator model
patchgan_discriminator.save_weights("discriminator.h5")