One-sixth / CVAE-GAN_tensorlayer

A CVAE-GAN implementation with tensorlayer1.x
21 stars 11 forks source link

Confusion #2

Open chengxiqiao opened 5 years ago

chengxiqiao commented 5 years ago

d_loss_real = tf.reduce_mean(tf.abs(discriminator_real_output - img)) d_loss_fake = tf.reduce_mean(tf.abs(discriminator_real_output - decoder_output)) d_loss_op = d_loss_real - kt d_loss_fake kt_update_op = tf.assign(kt, tf.clip_by_value(kt + lamda (gamma * d_loss_real - d_loss_fake), 0., 1.)) Thank you for sharing your code. I don't understand the discriminator 's loss that is different from the loss function in the paper

One-sixth commented 5 years ago

The DCGAN's loss should be used in the original article. But when I used DCGAN's loss, I found that the generation ability was not good, so I switched to BEGAN's Loss. I didn't read Paper carefully. I am not sure if I am mistaken.

chengxiqiao commented 5 years ago

"vae_net.py", line 13, in get_encoder c_net = tl.layers.OneHotInputLayer(c, 10, axis=-1, dtype=tf.float32) File "/python3/lib/python3.6/site-packages/tensorlayer/layers.py", line 367, in init Layer.init(self, inputs=inputs, name=name) File "/python3/lib/python3.6/site-packages/tensorlayer/layers.py", line 267, in init \nHint : Use different name for different 'Layer' (The name is used to control parameter sharing)" % name) Exception: Layer 'encoder/input_layer' already exists, please choice other 'name' or reuse this layer
Hint : Use different name for different 'Layer' (The name is used to control parameter sharing)

Thank you again. When i run the code, there is a mistake of reusing layer. How can i solve it?

One-sixth commented 5 years ago

You can try to avoid this by downgrading the tensorlayer version to 1.91. Or, according to the error prompt, give a new name to the error layer. Look here https://github.com/tensorlayer/tensorlayer/blob/TensorLayer-1.x/tensorlayer/layers/inputs.py#L70.