cameronfabbri / EBGAN-Tensorflow

Energy-Based Generative Adversarial Networks in Tensorflow
5 stars 1 forks source link

Tensorboard & Gray Scaled Images #1

Open mmosquera10 opened 6 years ago

mmosquera10 commented 6 years ago

Hello,

I am a beginner and I have been attempting to visualize the discriminator and generator losses on tensorboard, but I am having trouble. I ran the command tensorboard --logdir= directory_where_all_the_checkpoints_are. Any tips, will be highly appreciated.

Thank You, Maria M.

cameronfabbri commented 6 years ago

Hi. You have to do tensorboard --logdir=directory_where_all_the_checkpoints_are/logs/ You could also just cd into the checkpoint directory, then do tensorboard --logdir=logs/

mmosquera10 commented 6 years ago

@cameronfabbri Hello, again:

Thank you! Also, I have another question, the current network you have is only for RGB images, I modified the network to make it work for gray scale images by slightly changing the input tensor shape of the discriminator and the output tensor shape of the generator. I changed the dimensions to [batch_size, 64, 64, 1]. With those changes the network ran okay, however, the images generated up until the 112,500 step (or iteration), were all gray noise. So, I am assuming the network is not reading the gray scaled images properly. The dataset I am using is composed of .png images.

One thing I also noticed in the data_ops.py file is that you had: decoded_image = tf.image.decode_jpg(value, channels=3)

So, I changed that to: decoded_image = tf.image.decode_png(value, channels=1)

Is this all that is required to train gray scaled images?

Again, thank you for all of your help!

cameronfabbri commented 6 years ago

I haven't tried it with grayscale images. I think what may be going on is the preprocessing on the images. Most if not all GAN implementations assume the data is in the range [-1,1], so if you look here you'll see that I am assuming the original image is in [0,255] range, then converting it to [-1,1]. If you're loading up grayscale images, they may be in a range [0,1], so that line would mess some things up. I would try to make sure the data you are loading is in the [-1, 1] range, then when you are saving convert it back to [0,1] for grayscale.