open-mmlab / mmgeneration

MMGeneration is a powerful toolkit for generative models, based on PyTorch and MMCV.
https://mmgeneration.readthedocs.io/en/latest/
Apache License 2.0
1.91k stars 232 forks source link

About the FFHQ dataset #472

Closed zxxxxxxh closed 1 year ago

zxxxxxxh commented 2 years ago

How to train styleGANv1 using FFHQ dataset in Windows 11?I reported an error using the official FFHQ dataset for training. ![Uploading 2.png…]()

zxxxxxxh commented 2 years ago
2
LeoXing1996 commented 2 years ago

Hey @zxxxxxxh, to save training time, we preprocess the training dataset and save them based on the resolution (e.g., ffhq_64, ffhq_128...).

If you do not want to preprocess the training data, you can modify the dataset config as following:

data = dict(
    samples_per_gpu=64,
    workers_per_gpu=4,
    train=dict(
        type='GrowScaleImgDataset',
        imgs_roots=dict({
            '1024': './data/ffhq/images',
        }),
        pipeline=train_pipeline,
        gpu_samples_base=4,
        gpu_samples_per_scale={
            '4': 64,
            '8': 32,
            '16': 16,
            '32': 8,
            '64': 4,
            '128': 4,
            '256': 4,
            '512': 4,
            '1024': 4
        },
        len_per_stage=300000))
zxxxxxxh commented 2 years ago

Thank you for your reply. I modified the dataset config according to your instructions. then the program has a problem with update_dataloader, there is no update_sampler attribute. Also, the curr_scale is 8 and I am not sure if this is correct.

3

Hey @zxxxxxxh, to save training time, we preprocess the training dataset and save them based on the resolution (e.g., , ...).ffhq_64``ffhq_128

If you do not want to preprocess the training data, you can modify the dataset config as following:

data = dict(
    samples_per_gpu=64,
    workers_per_gpu=4,
    train=dict(
        type='GrowScaleImgDataset',
        imgs_roots=dict({
            '1024': './data/ffhq/images',
        }),
        pipeline=train_pipeline,
        gpu_samples_base=4,
        gpu_samples_per_scale={
            '4': 64,
            '8': 32,
            '16': 16,
            '32': 8,
            '64': 4,
            '128': 4,
            '256': 4,
            '512': 4,
            '1024': 4
        },
        len_per_stage=300000))
LeoXing1996 commented 2 years ago

@zxxxxxxh Can you provide the full config you used?

zxxxxxxh commented 2 years ago

python tools\train.py D:\mmgeneration-master\configs\styleganv1\styleganv1_ffhq_256_g8_25Mimg.py --work-dir D:\mmgeneration-master\work_dirs\experiments\FFHQ