Open infinityrgb opened 2 years ago
You probably have less than 105 labels in you datset. Try --label_nc 104
I have the same issue, when changing the number of labels from the default 19 to 42 it errors out similarly, looks like label_nc changes are not properly supported:
middle_mu = F.relu(self.__getattr__('fc_mu' + str(j))(style_codes[i][j])) File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in __getattr__ raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'ACE' object has no attribute 'fc_mu19'
I have double and triple checked that my dataset is properly formatted according to the author guidelines.
Yes, exactly, you need to modify the code in normalization.py
for it to work with more labels. I'll try to make a pull request to fix it.
Yes, exactly, you need to modify the code in
normalization.py
for it to work with more labels. I'll try to make a pull request to fix it.
How to change? can you give me some tips?
As you can see in:
There are only 19 fc_muXX
, if you want more classes you need to add more, if not it will error out. There are more hardcoded things throughout the repo, so be on the lookout, I wish I could enumerate every single one, but it has been a while since I dealt with this codebase.
As you can see in:
There are only 19
fc_muXX
, if you want more classes you need to add more, if not it will error out. There are more hardcoded things throughout the repo, so be on the lookout, I wish I could enumerate every single one, but it has been a while since I dealt with this codebase.
I see. I used following codes to help generate these sentences and paste them to 'normalization.py' and set the num of classes ahead.
generated_list_txt=open('more_fc_mu.txt', mode='a+')
for i in range(151):
generated_list_txt.writelines(f'self.fc_mu{i} = nn.Linear(style_length, style_length)' + '\n')
Traceback (most recent call last): File "train.py", line 47, in
trainer.run_generator_one_step(data_i)
File "/d6295745ef534beab3ce2490bedcd8ab/lxy/inkpaint/SEAN/trainers/pix2pix_trainer.py", line 35, in run_generator_one_step
g_losses, generated = self.pix2pix_model(data, mode='generator')
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 541, in call
result = self.forward(*input, kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/data_parallel.py", line 150, in forward
return self.module(*inputs[0], *kwargs[0])
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 541, in call
result = self.forward(input, kwargs)
File "/d6295745ef534beab3ce2490bedcd8ab/lxy/inkpaint/SEAN/models/pix2pix_model.py", line 45, in forward
input_semantics, real_image)
File "/d6295745ef534beab3ce2490bedcd8ab/lxy/inkpaint/SEAN/models/pix2pix_model.py", line 144, in compute_generator_loss
input_semantics, real_image, compute_kld_loss=self.opt.use_vae)
File "/d6295745ef534beab3ce2490bedcd8ab/lxy/inkpaint/SEAN/models/pix2pix_model.py", line 196, in generate_fake
fake_image = self.netG(input_semantics, real_image)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 541, in call
result = self.forward(*input, kwargs)
File "/d6295745ef534beab3ce2490bedcd8ab/lxy/inkpaint/SEAN/models/networks/generator.py", line 84, in forward
x = self.head_0(x, seg, style_codes, obj_dic=obj_dic)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 541, in call
result = self.forward(*input, *kwargs)
File "/d6295745ef534beab3ce2490bedcd8ab/lxy/inkpaint/SEAN/models/networks/architecture.py", line 75, in forward
dx = self.ace_0(x, seg, style_codes, obj_dic)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 541, in call
result = self.forward(input, kwargs)
File "/d6295745ef534beab3ce2490bedcd8ab/lxy/inkpaint/SEAN/models/networks/normalization.py", line 157, in forward
middle_mu = F.relu(self.getattr('fc_mu' + str(j))(style_codes[i][j]))
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 585, in getattr
type(self).name, name))
AttributeError: 'ACE' object has no attribute 'fc_mu105'
I have meet this question, someone can help me?