-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'ACE' object has no attribute 'fc_mu105' #46
Comments
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:
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 |
How to change? can you give me some tips? |
As you can see in: SEAN/models/networks/normalization.py Lines 209 to 227 in 04c7536
There are only 19 |
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?
The text was updated successfully, but these errors were encountered: