Searching towards Class-Aware Generators for Conditional Generative Adversarial Networks paper
- To refactor and open source all the code (2022-7-2).
- This paper has not been accepted and is currently not being resubmitted. I currently have no plans to organize and open source the search code. (2021-10-19)
- Support DistributedDataParallel (2020-09-17)
- Evaluation code
- Search code
- CUDA 10.0; cudnn-10.0-v7.6.5; Python == 3.6
- PyTorch == 1.4.0, torchvision == 0.5.0
pip install torch==1.4.0+cu100 torchvision==0.5.0+cu100 -f https://download.pytorch.org/whl/torch_stable.html
- detectron2
python -m pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu100/index.html
- TensorFlow == 1.13.1
pip install tensorflow-gpu==1.13.1
- Additional used packages
pip install -r requirements.txt
git clone --recursive https://github.com/PeterouZh/NAS_cGAN.git
cd NAS_cGAN
Pre-calculate FID statistic files of CIFAR10 using PyTorch and TensorFlow models, respectively. Those files will be saved to ./datasets/nas_cgan/pytorch_fid_stat/fid_stats_pytorch_cifar10_train_32.npz and ./datasets/nas_cgan/tf_fid_stat/fid_stats_tf_cifar10_train_32.npz.
Or you can download our pre-calculated statistic files onedrive, which should be put into the directories mentioned above.
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:/usr/local/cudnn-10.0-v7.6.5.32/lib64:$LD_LIBRARY_PATH
export CUDA_VISIBLE_DEVICES=0
export PYTHONPATH=.:./exp
python exp/nas_cgan/scripts/train_net.py \
--config exp/nas_cgan/configs/calculate_fid_stat_CIFAR10.yaml \
--command calculate_fid_stat_CIFAR10 \
--outdir results/calculate_fid_stat_CIFAR10
Download the trained models onedrive, and put them into ./datasets/nas_cgan/models.
Eval NAS-cGAN on CIFAR10.
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:/usr/local/cudnn-10.0-v7.6.5.32/lib64:$LD_LIBRARY_PATH
export CUDA_VISIBLE_DEVICES=0
export PYTHONPATH=.:./exp
python exp/nas_cgan/scripts/train_net.py \
--config exp/nas_cgan/configs/eval_NAS_cGAN_CIFAR10.yaml \
--command eval_NAS_cGAN_CIFAR10 \
--outdir results/eval_NAS_cGAN_CIFAR10
Eval NAS-caGAN on CIFAR10.
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:/usr/local/cudnn-10.0-v7.6.5.32/lib64:$LD_LIBRARY_PATH
export CUDA_VISIBLE_DEVICES=0
export PYTHONPATH=.:./exp
python exp/nas_cgan/scripts/train_net.py \
--config exp/nas_cgan/configs/eval_NAS_caGAN_CIFAR10.yaml \
--command eval_NAS_caGAN_CIFAR10 \
--outdir results/eval_NAS_caGAN_CIFAR10
Pre-calculate intra FID statistic of each class on CIFAR10. Or you can use our pre-calculated files onedrive, and put these files in ./datasets/nas_cgan/tf_fid_stat/cifar10_train_per_class_32.
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:/usr/local/cudnn-10.0-v7.6.5.32/lib64:$LD_LIBRARY_PATH
export CUDA_VISIBLE_DEVICES=0
export PYTHONPATH=.:./exp
python exp/nas_cgan/scripts/train_net.py \
--config exp/nas_cgan/configs/calculate_fid_stat_per_class_CIFAR10.yaml \
--command calculate_fid_stat_per_class_CIFAR10 \
--outdir results/calculate_fid_stat_per_class_CIFAR10
Eval intra FIDs for NAS-cGAN.
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:/usr/local/cudnn-10.0-v7.6.5.32/lib64:$LD_LIBRARY_PATH
export CUDA_VISIBLE_DEVICES=0
export PYTHONPATH=.:./exp
python exp/nas_cgan/scripts/train_net.py \
--config exp/nas_cgan/configs/eval_intra_FID_NAS_cGAN_CIFAR10.yaml \
--command eval_intra_FID_NAS_cGAN_CIFAR10 \
--outdir results/eval_intra_FID_NAS_cGAN_CIFAR10
Eval intra FIDs for NAS-caGAN.
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:/usr/local/cudnn-10.0-v7.6.5.32/lib64:$LD_LIBRARY_PATH
export CUDA_VISIBLE_DEVICES=0
export PYTHONPATH=.:./exp
python exp/nas_cgan/scripts/train_net.py \
--config exp/nas_cgan/configs/eval_intra_FID_NAS_caGAN_CIFAR10.yaml \
--command eval_intra_FID_NAS_caGAN_CIFAR10 \
--outdir results/eval_intra_FID_NAS_caGAN_CIFAR10
Prepare intra FID statistic files following the steps above (put these files in ./datasets/nas_cgan/tf_fid_stat/cifar10_train_per_class_32). Download FID logits files onedrive produced by the calibrated models, and put the files into ./datasets/nas_cgan/fid_logits_of_calibrated_model/.
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:/usr/local/cudnn-10.0-v7.6.5.32/lib64:$LD_LIBRARY_PATH
export CUDA_VISIBLE_DEVICES=0
export PYTHONPATH=.:./exp
python exp/nas_cgan/scripts/train_net.py \
--config exp/nas_cgan/configs/eval_calibrated_NAS_cGAN.yaml \
--command eval_calibrated_NAS_cGAN \
--outdir results/eval_calibrated_NAS_cGAN
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:/usr/local/cudnn-10.0-v7.6.5.32/lib64:$LD_LIBRARY_PATH
export CUDA_VISIBLE_DEVICES=0
export PYTHONPATH=.:./exp
python exp/nas_cgan/scripts/train_net.py \
--config exp/nas_cgan/configs/eval_calibrated_NAS_caGAN.yaml \
--command eval_calibrated_NAS_caGAN \
--outdir results/eval_calibrated_NAS_caGAN
- https://github.com/facebookresearch/detectron2
- https://github.com/TDeVries/enas_pytorch
- https://github.com/TAMU-VITA/AutoGAN
- https://github.com/ajbrock/BigGAN-PyTorch
- https://github.com/rosinality/stylegan2-pytorch
- https://github.com/openai/improved-gan/tree/master/inception_score
- https://github.com/bioinf-jku/TTUR