I'm getting the following error:
AttributeError: cannot assign module before Module.init() call
I'm trying to create an instance of my class :
class ResNetGenerator(nn.Module):
def __init__(self, input_nc=3, output_nc=3, n_residual_blocks=9, use_dropout=False):
# super(ResNetGenerator, self).__init__()
super().__init__()
I'm calling super().__init__() but in vain.
What I am doing wrong here?
Complete Traceback:
File "train.py", line 40, in <module>
model = ColorizationCycleGAN(args)
File "/path/cycle_gan.py", line 27, in __init__
self.G_A2B = ResNetGenerator(input_nc=self.input_nc, output_nc=self.output_nc, n_residual_blocks=9, use_dropout=False)
File "/path/.local/lib/python3.6/site packages/torch/nn/modules/module.py", line 544, in __setattr__
"cannot assign module before Module.__init__() call")
AttributeError: cannot assign module before Module.__init__() call