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

missing files for celeba preprocessing #3

Closed
romain-rsr opened this issue Nov 28, 2022 · 3 comments
Closed

missing files for celeba preprocessing #3

romain-rsr opened this issue Nov 28, 2022 · 3 comments

Comments

@romain-rsr
Copy link

Hi,

We are highly interested by your work, yet we can't find the following files on the download links you provided for celeba :

data/celeba_wild_raw/MAFL/celebA_training.txt
data/celeba_wild_raw/MAFL/training.txt
data/celeba_wild_raw/MAFL/testing.txt

Since these file seem mandatory to run the celeba dataset preprocessing, can you please indicate where we can download them.

Many thanks in advance,
Romain

@romain-rsr
Copy link
Author

romain-rsr commented Nov 28, 2022

we were able to download the flower dataset and apply your flower preprocessing file on it, yet when we try to train the file we get this error :

Traceback (most recent call last):
  File "train_gan.py", line 87, in <module>
    generator = model.Generator(dparams).to(device)
  File "x/xingseg/models/generator.py", line 152, in __init__
    if 'celeba' in hyper_paras['class_name'] or 'taichi' in hyper_paras['class_name'] or 'flower' in hyper_paras['class_name'] or 'cub' in hyper_paras['class_name']:
KeyError: 'class_name'

apparently a 'class_name' key was missing from the dict fed into the Generator in train_gan.py :

generator = model.Generator(dparams={   'z_dim': args.z_dim, 
            'n_keypoints': args.n_keypoints, 
            'n_per_kp': args.n_per_kp,
            'n_embedding': args.n_embedding,
            'image_size': args.image_size,
            'feature_map_sizes': args.feature_map_sizes,
            'feature_map_channels': args.feature_map_channels,
            'single_final': args.single_final, 
            'use_linear': args.use_linear,
            'smaller_init_mask': args.smaller_init_mask
}).to(device)

we then added this line in the dict : 'class_name':args.class_name,

but then we got this error :

RuntimeError: Caught RuntimeError in replica 0 on device 0.
Original Traceback (most recent call last):
  File "x/envs/xingseg/lib/python3.8/site-packages/torch/nn/parallel/parallel_apply.py", line 64, in _worker
    output = module(*input, **kwargs)
  File "x/micromamba/envs/xingseg/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl
    return forward_call(*input, **kwargs)
  File "/x/xingseg/models/generator.py", line 298, in forward
    out_batch = self.gen_foreground(out_batch)
  File "/x/xingseg/models/generator.py", line 403, in gen_foreground
    heatmaps = current_kp_mask.unsqueeze(2) * kp_emb.unsqueeze(-1).unsqueeze(-1)
RuntimeError: The size of tensor a (63) must match the size of tensor b (8) at non-singleton dimension 1

Can you please help us to identify the meaning of this size mismatch, and how to resolve it ?

Thanks in advance
Romain

@xingzhehe
Copy link
Owner

xingzhehe commented Nov 28, 2022

Hi Romain,

Thanks for your interests in our work.

  1. I double checked and did find the files in https://github.com/xingzhehe/GANSeg/tree/main/data/celeba_wild_raw/MAFL. Please ping me again if you cannot find them.

  2. Thanks for the missing keys! I have added it to the file.

  3. As for the mismatch dimensions. I ran the experiments and didn't get any errors. It would be great if you could tell me which hyperparameters you changed. Since pytorch has a weird bug in loading weights, I have to hard code the structure from line 149-225 in models/generator.py as what they were during training, so that it can take the pre-trained weights. I am so sorry for the inconvenience, and wish pytorch to fix that issue soon.

@romain-rsr
Copy link
Author

Thanks for your reactivity and these explanations, we were finally able to run the celeba example without any problem.

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

No branches or pull requests

2 participants