Skip to content
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

Fix projection for class conditioned networks #79

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

namangup
Copy link

Currently, the code produces an error for networks trained with class conditioning. Fixed it by allowing addition of an explicit label.
File "projector.py", line 197, in run_projection verbose=True File "projector.py", line 60, in project w_samples = G.mapping(torch.from_numpy(z_samples).to(device), label) # [N, L, C] File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "<string>", line 222, in forward File "/home/ubuntu/misc/stylegan2-ada-pytorch/torch_utils/misc.py", line 81, in assert_shape if tensor.ndim != len(ref_shape): AttributeError: 'NoneType' object has no attribute 'ndim'

@yixin1024
Copy link

Hi,I change the projector.py . But it also has this question. Do you solve it? thank you!

@namangup
Copy link
Author

Hi,I change the projector.py . But it also has this question. Do you solve it? thank you!

Yes, with the changes it should work. Make sure to use the new options --label and --label-dim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants