VICO-UoE / IT-GAN

20 stars 6 forks source link

How to finetune BigGAN on custom datasets? #3

Closed Yearsflow closed 10 months ago

Yearsflow commented 10 months ago

Hi,

Sorry to bother you again. Last time I wondered how to get pretrained BigGAN parameters on custom datasets, you told me that I could finetune BigGAN. Should I just load pretrained Image-Net parameters and freeze other layers except the last fully-connected layers? I tried to train BigGAN but I found that I didn't have enough GPU memory to train it. Could you please give me some advice? Thank you very much. ^_^

PatrickZH commented 10 months ago

Hi, I followed BigGAN official repo and trained models for CIFAR datasets from scratch. I don't know how many data do you have in your custom datasets. So, finetuning the ImageNet-version BigGAN can be better choice. It does need a lot of GPU memory due to the image size. Maybe you can try some tricks like model quantization or reduce the batchsize.

Yearsflow commented 10 months ago

Thanks for your advice. My custom dataset includes more than 20,000 images with 224*224 size. I can't afford the cost of GPU memory. By the way, if I want to finetune ImageNet-version BigGAN, should I just freeze the most of layers except the last fully-connected layers? Is it right to finetune? I don't know much about finetuning model, so I appreciate it if you can answer me.

PatrickZH commented 10 months ago

You may need to find some tutorial for GAN finetuning. Maybe you can set a very small learning rate and tune all parameters.

Yearsflow commented 10 months ago

Thank you very much. It helps me a lot.