Open daxjain789 opened 4 years ago
@daxjain789 , I didn't check the train.py in this repository, only ran the test.py, hence I am not sure what's causing it. You may refer to the original repository of acgpn for the train scripts.
This will solve the issue, after model.initialize(), add the below code .Here,the model is wrapped around the DataParallel and the 'module' attribute is coming from here.
model = torch.nn.DataParallel(model, device_ids=[0]) #0 because of only 1 GPU, add [0,1,2,3] if you have multiple GPUs
I have searched the entire repo but still couldn't find the solution for the above error. Any solution for this ?
File "train.py", line 168, in <module> loss_dict = dict(zip(model.module.loss_names, losses)) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 772, in __getattr__ type(self).__name__, name)) torch.nn.modules.module.ModuleAttributeError: 'Pix2PixHDModel' object has no attribute 'module'