IDEALLab / bezier-gan

Bézier Generative Adversarial Networks
MIT License
37 stars 21 forks source link

ADAPTING TO TENSORFLOW 2X #10

Closed sarapuccia1 closed 12 months ago

sarapuccia1 commented 1 year ago
 def train(self, X_train, train_steps=2000, batch_size=256, save_interval=0, directory='.'):

        #tf.compat.v1.disable_eager_execution()

        X_train = preprocess(X_train)

        X_train = preprocess(X_train)

        # Inputs

        tf.compat.v1.disable_eager_execution()

        self.x = tf.compat.v1.placeholder(tf.float32, shape=(None,)+self.X_shape, name='real_image')

        self.c = tf.compat.v1.placeholder(tf.float32, shape=[None, self.latent_dim], name='latent_code')

        self.z = tf.compat.v1.placeholder(tf.float32, shape=[None, self.noise_dim], name='noise')

        # Targets

        q_target = tf.compat.v1.placeholder(tf.float32, shape=[None, self.latent_dim])

        # Outputs

        d_real, _ = self.discriminator(self.x)

        x_fake_train, cp_train, w_train, ub_train, db_train = self.generator(self.c, self.z)

        d_fake, q_fake_train = self.discriminator(x_fake_train)

I'm trying to adapt the code to tensorflow 2.10 since I need it for my master thesis. I have some problems to "translate" the above lines since in tensorflow 2.10 the placeholder function has been have been replaced by more dynamic mechanisms like tf.data.Dataset and function arguments. Do you have some ideas about how can I handle it?

Thanks in advanced, Sara

zakaria-hassoun commented 7 months ago

I'm encountering an issue with the directory after training the code, and I'm unsure about how to find the result. Could you provide guidance or instructions to help me understand and resolve this problem with the directory?