1 Star 2 Fork 1

TensorLayer / cyclegan

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

The Simplest CycleGAN Full Implementation

Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks

Requirement

Check the requirements.txt

TODO

  • replay buffer

Run

It will automatically download the data in data.py.

python3 train.py

Distributed Training

GAN-like networks are particularly challenging given that they often use multiple optimizers. In addition, GANs also consume a large amont of GPU memory and are usually batch-size sensitive.

To speed up training, we thus use a novel KungFu distributed training library. KungFu is easy to install and run (compared to today's Horovod library which depends on OpenMPI). You can install it using a few lines by following the instruction. KungFu is also very fast and scalable, compared to Horovod and parameter servers, making it an attractive option for GAN networks.

In the following, we assume that you have added kungfu-run into the $PATH.

(i) To run on a machine with 4 GPUs:

kungfu-run -np 4 python3 train.py --parallel --kf-optimizer=sma

The default KungFu optimizer is sma which implements synchronous model averaging. The sma decouple batch size and the number of GPUs, making it hyper-parameter-robust during scaling. You can also use other KungFu optimizers: sync-sgd (which is the same as the DistributedOptimizer in Horovod) and async-sgd if you train your model in a cluster that has limited bandwidth and straggelers.

(ii) To run on 2 machines (which have the nic eth0 with IPs as 192.168.0.1 and 192.168.0.2):

kungfu-run -np 8 -H 192.168.0.1:4,192.168.0.1:4 -nic eth0 python3 train.py --parallel --kf-optimizer=sma

Results

Author

  • @zsdonghao
  • @luomai

Discussion

License

空文件

简介

CycleGAN 开源中国官方镜像 展开 收起
Python
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/TensorLayer/cyclegan.git
git@gitee.com:TensorLayer/cyclegan.git
TensorLayer
cyclegan
cyclegan
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891