paarthneekhara / text-to-image

Text to image synthesis using thought vectors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use of tf.nn.moments in batch_norm class

rajmphasis opened this issue · comments

As I went through the code, in Discriminator code, we are using the same block thrice, Once for real images, then for fake and wrong images with variable reuse. But when we reach "batch_norm" __call() function, for Second time with reuse=True, it tries to reuse all the variables in __call(). Similar thing happens with ema.apply(). We have created two variables batch_mean and batch_var which we pass to ema.apply(). Then as we have already set reuse to True, these variables do not get added to our global_variables list.
So , as this code has single scope for all variables in __call() with reuse being set to True, there is conflict. I am not able to run that code segment. Any explanation on use of tf.nn.moments in __call() will be appreciated.

Thanks