except ImportError: print('Unable to load classifier. Please run classifier script first') sys.exit() # Encoder # Create encoder generator encoder_generator_creator = GeneratorModelCreator(constants.INPUT_SHAPE, constants.OUTPUT_SHAPE, from_image=True, to_image=True, activation='tanh') encoder_generator = encoder_generator_creator.create_model() # Create encoder discriminator encoder_discriminator_creator = DiscriminatorModelCreator( constants.INPUT_SHAPE) encoder_discriminator = encoder_discriminator_creator.create_model() # Create GAN model to combine encoder generator and discriminator encoder_gan_creator = EncoderGanModelCreator(encoder_generator, encoder_discriminator) encoder_gan = encoder_gan_creator.create_model() # Decoder # Create decoder generator decoder_generator_creator = GeneratorModelCreator(constants.INPUT_SHAPE, constants.OUTPUT_SHAPE, from_image=True, to_image=True, activation='tanh')