--phase train: AttributeError: 'CycleGANModel' object has no attribute 'real_A'
Hello! I am training cycle_gan with dataset_mode equal to unaligned. My environment is: Python -> 3.8.10 torch -> 1.8.1+cu102 OS -> Linux Mint 20.2 Cinnamon
I had passed parameter --phase train however I am facing an error AttributeError: 'CycleGANModel' object has no attribute 'real_A' .
Complete stacktrace was
Traceback (most recent call last):
File "train.py", line 43, in
and I tracked file. I see in train.py file, line 43 function model.optimized_parameters() is called before call of model.set_input(). While model.set_input() initializes self.real_A and model.optimized_parameters() uses self.real_A.
Am I making a mistake or it's a bug?
model.set_input() is called first in the training script https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/003efc4c8819de47ff11b5a0af7ba09aee7f5fc1/train.py#L51-L52
Maybe you swapped them by accident?
maybe. Thanks for update. Looking back at it after 1+ year.