DCGAN example gives negatives from Sigmoid when using data_parallel

Thanks for the code. I cannot reproduce this issue and all 25 training epochs are running fine.
I’ve added these checks for the netD output:

        output = netD(fake.detach())
        if (output < 0.0).any():
            print('netD output is negative')
            print(output)
            raise RuntimeError
...
        output = netD(fake)
        if (output < 0.0).any():
            print('netD output is negative')
            print(output)
            raise RuntimeError

Could you update PyTorch to the latest version as I’ve checked it with the current nightly binary 1.7.0.dev20200928.

1 Like