BEGAN in PyTorch
This project is still in progress. If you are looking for the working code, use BEGAN-tensorflow.
Requirements
- Python 2.7
- Pillow
- tqdm
- PyTorch
- torch-vision
- requests (Only used for downloading CelebA dataset)
- TensorFlow (Only used TensorBoard for logging)
Usage
First download CelebA datasets with:
$ apt-get install p7zip-full # ubuntu
$ brew install p7zip # Mac
$ python download.py
or you can use your own dataset by placing images like:
data
โโโ YOUR_DATASET_NAME
โโโ xxx.jpg (name doesn't matter)
โโโ yyy.jpg
โโโ ...
To train a model:
$ python main.py --dataset=CelebA --num_gpu=1
$ python main.py --dataset=YOUR_DATASET_NAME --num_gpu=4 --use_tensorboard=True
To test a model (use your load_path
):
$ python main.py --dataset=CelebA --load_path=./logs/CelebA_0405_124806 --num_gpu=0 --is_train=False --split valid
Results
- BEGAN-tensorflow at least can generate human faces but BEGAN-pytorch can't.
- Both BEGAN-tensorflow and BEGAN-pytorch shows modal collapses and I guess this is due to a wrong scheuduling of lr (Paper mentioned that simply reducing the lr was sufficient to avoid them).
(in progress)
Author
Taehoon Kim / @carpedm20