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

how to create dataset with label #22

Closed
Johnson-yue opened this issue Oct 29, 2020 · 9 comments
Closed

how to create dataset with label #22

Johnson-yue opened this issue Oct 29, 2020 · 9 comments

Comments

@Johnson-yue
Copy link

If I want to finetune stylegan2-ada with conditional label how I prepare dataset ??

the readem had only for cifar10 dataset with conditional but how to use for my own dataset??

what is the format of data ?

@aiXander
Copy link

aiXander commented Oct 29, 2020

Here is my jupter notebook to create conditional datasets.

Note: this will not work out-of-the-box with StyleGAN's default dataloader, I'm using a tf_raw format, simply replace the dataset_tool.py file with this one and it should work.

Main benefit of the raw_tfrecords is that they are about ~10 times smaller than the original tfrecs which is insanely helpful if you ask me...

@Johnson-yue
Copy link
Author

Johnson-yue commented Oct 30, 2020

@tr1pzz thank you , I will try it .

If I want to finetune stylegan2 checkpoint with conditional dataset , can I still use the same pretrained checkpoints with unconditional dataset?

@Johnson-yue
Copy link
Author

Johnson-yue commented Oct 30, 2020

@tr1pzz Hi, my data is gray image ,so it PIL.image.open(file) have a (256, 256) and
I replace the original dataset_tool.py with your dataset_tool.py and then use your jupyter notebook create a tfrecord successfully!

but when I try finetuning , has a error about dataset.load_dataset() function

****/training/dataset.py", line 219, in parse_tfrecord_np
    data = ex.features.feature["data"].bytes_list.value[0]    # pylint : disable=no-member original
IndexError: list index (0) out of range

then I debug and found :
ex.features.feature["data"].bytes_list.value[0] == None
but
ex.features.feature["img"].bytes_list.value[0] is good data
I can not load the tfrecord, why ?

original dataset_tool.py output is multi-resolution tfrreconrd file ,but my create is only one max-resolution tfrecord file is this a problem?

@aiXander
Copy link

aiXander commented Nov 2, 2020

Yeah, forgot about that, you also have to update a few minor things in dataset.py
You can take a look at the changes in this repo.
Let me know if you get stuck, it should be an easy fix to figure out!

@Johnson-yue
Copy link
Author

@tr1pzz Hi ,I rewrite the data_tools.py reference create_cifar10 dataset ,and not change the dataset.py, Thank you for your help

@ivanlen
Copy link

ivanlen commented Apr 4, 2021

Hey @Johnson-yue , were you able to train the conditional version from a pretrained unconditional one?

@ivanlen
Copy link

ivanlen commented Apr 4, 2021

Hi @aiXander , can you share again the notebook to generate a conditioned GAN from an uncoditioned?
cheers!

@jazz-ai
Copy link

jazz-ai commented Oct 5, 2021

Here is my jupter notebook to create conditional datasets.

Note: this will not work out-of-the-box with StyleGAN's default dataloader, I'm using a tf_raw format, simply replace the dataset_tool.py file with this one and it should work.

Main benefit of the raw_tfrecords is that they are about ~10 times smaller than the original tfrecs which is insanely helpful if you ask me...

Hi @aiXander, can you please repost the link to create conditional datasets.The above link is not working.

@Johnson-yue
Copy link
Author

Hey @Johnson-yue , were you able to train the conditional version from a pretrained unconditional one?

no, because this not support!! there are not pretrained conditional weight for finetuning

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

4 participants