Code Monkey home page Code Monkey logo

freezed's Introduction

FreezeD: a Simple Baseline for Fine-tuning GANs

Update (2020/10/28)

Release checkpoints of StyleGAN fine-tuned on cat and dog datasets.

Update (2020/04/06)

Current code evaluates FID scores with inception.train() mode. Fixing it to inception.eval() may degrade the overall scores (both competitors and ours; hence the trend does not change). Thanks to @jychoi118 (Issue #3) for reporting this.


Official code for "Freeze the Discriminator: a Simple Baseline for Fine-Tuning GANs" (CVPRW 2020).

The code is heavily based on the StyleGAN-pytorch and SNGAN-projection-chainer codes.

See stylegan and projection directory for StyleGAN and SNGAN-projection experiments, respectively.

Note: There is a bug in PyTorch 1.4.0, hence one should use torch>=1.5.0 or torch<=1.3.0. See Issue #1.

Generated samples

Generated samples over fine-tuning FFHQ-pretrained StyleGAN

 

More generated samples (StyleGAN)

Generated samples under Animal Face and Anime Face datasets

   

   

   

   

   

   

   

   

   

   

More generated samples (SNGAN-projection)

Comparison of fine-tuning (left) and freeze D (right) under Oxford Flower, CUB-200-2011, and Caltech-256 datasets

Freeze D generates more class-consistent results (see row 2, 8 of Oxford Flower)

 

 

 

Citation

If you use this code for your research, please cite our papers.

@inproceedings{
    mo2020freeze,
    title={Freeze the Discriminator: a Simple Baseline for Fine-Tuning GANs},
    author={Mo, Sangwoo and Cho, Minsu and Shin, Jinwoo},
    booktitle = {CVPR AI for Content Creation Workshop},
    year={2020},
}

freezed's People

Contributors

johnson-yue avatar sangwoomo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

freezed's Issues

Hi , Would you release your experiments environment?

I am using, python3.7.3, cuda 10.0, cudnn 7.6.1 and then I run finetune.py as command:
python finetune.py --name AnimalFace_finetune --mixing --loss r1 --sched --dataset AnimalFace

and the Bug is :

cuDNN error: CUDNN_STATUS_NOT_SUPPORTED. This error may appear if you passed in a non-contiguous input

bug occur in line 312 in finetune.py

Do you understand this bug meaning???

how to generate a image with same label?

Hi, you idea is very useful and interesting .

as I know the style GAN is non-conditional generate model.So how to get an image with same label
like in ReadMe.md file ?
an image have all eagle, an image have all panda ....

How to do it ?

Did you only use one class data to finetune styleGAN model ?? or use some other tricks

The details of the datasets

The work is interesting. I want to train my model with your datasets. Could you please provide more detailed description of the datasets used in the Table 1 in the paper. For example, which 100 samples you have used in the Table 1.

you should change inception model to evaluation mode before calculating FID score

You should change inception model to evaluation mode before calculating FID score.
Inception model contains batch normalization, whose training and evaluation behaviors are different.

For example, you should add "inception.eval()" below line 486 of stylegan/finetune.py

With this correction, I got significantly different FID score comparing to reports from your paper.

About preprocessing data when using stylegan

According to your code in readme.me https://github.com/sangwoomo/FreezeD/tree/master/stylegan, we should run this to preprocess the data:
python prepare_data.py --out dataset/DATASET_lmdb --n_worker 8 dataset/DATASET
But in prepare_data.py:
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', type=str, required=True, help='dataset name')
parser.add_argument('--n_worker', type=int, default=8)
So your code in the readme.me seems to be wrong.

Cuda out of memory

Hi,

Thank you for organizing the code. I just want to know the minimum gpu requirement and time the model will take to finetune after we have that resource. Since with 8 GB GPU memory even batch_size =1 ( in finetune.py ) , gives the cuda out of memory error.

AttributeError: 'NoneType' object has no attribute 'decode'

When I try to run precompute_acts.py, there comes an error:

Traceback (most recent call last):
File "precompute_acts.py", line 41, in
dataset = MultiResolutionDataset(f'./dataset/{args.dataset}_lmdb', transform)
File "/content/drive/My Drive/FreezeD-master/stylegan/dataset.py", line 23, in init
self.length = int(txn.get('length'.encode('utf-8')).decode('utf-8'))
AttributeError: 'NoneType' object has no attribute 'decode'

I'm trying to figure this out, but could you please take a look at this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.