After few iterations: 'Variable' object is not callable

Hi,
I am facing a strange issue. I am trying to get WGAN-GP model running in pytorch. It seems like while training for first few iteration everything seems to run fine, but after that the model for generator throws the error ‘Variable’ object is not callable which is strange because for the previous iteration everything was fine. For example:



My code can be found here: https://github.com/udion/gmmGAN/blob/master/testbed.ipynb
The reference code I used in my notebook is here: https://github.com/caogang/wgan-gp/blob/master/gan_toy.py

please help.

Hi,

I think the problem is that you gave multiple things called G: both the net that outputs gop and the output of the D network.

1 Like

umm, output of network D is D_fake and D_real, what do you mean by output of it to be G?

Alban meant in your G part not D part.

1 Like

I guess here, G is a network of some kind:
image

In the same scope, here, G becomes a Variable:
image

When hitting the first snippet above after the second, you would get the error, Variable is not callable.

Yes got it. Thank you and sorry.