{"id":13612639,"url":"https://github.com/tensorlayer/cyclegan","last_synced_at":"2025-04-24T11:31:24.467Z","repository":{"id":72877638,"uuid":"193867467","full_name":"tensorlayer/cyclegan","owner":"tensorlayer","description":"CycleGAN in 300 lines of code ","archived":false,"fork":false,"pushed_at":"2020-01-28T21:52:02.000Z","size":9388,"stargazers_count":20,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T04:13:06.299Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://tensorlayer.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tensorlayer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-06-26T08:54:18.000Z","updated_at":"2024-02-26T12:28:35.000Z","dependencies_parsed_at":"2023-02-23T13:00:23.080Z","dependency_job_id":null,"html_url":"https://github.com/tensorlayer/cyclegan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorlayer%2Fcyclegan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorlayer%2Fcyclegan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorlayer%2Fcyclegan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorlayer%2Fcyclegan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tensorlayer","download_url":"https://codeload.github.com/tensorlayer/cyclegan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250618195,"owners_count":21460042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T20:00:32.630Z","updated_at":"2025-04-24T11:31:23.369Z","avatar_url":"https://github.com/tensorlayer.png","language":"Python","readme":"# The Simplest CycleGAN Full Implementation\n\nUnpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks\n\n## Requirement\n\nCheck the `requirements.txt`\n\n## TODO\n- replay buffer\n\n## Run\n\nIt will automatically download the data in `data.py`.\n\n```python\npython3 train.py\n```\n\n## Distributed Training\n\nGAN-like networks are particularly challenging given that they often use multiple optimizers.\nIn addition, GANs also consume a large amont of GPU memory and are usually batch-size sensitive.\n\nTo speed up training, we thus use a novel [KungFu](https://github.com/lsds/KungFu) distributed training library.\nKungFu is easy to install and run (compared to today's Horovod library\nwhich depends on OpenMPI). You can install it using a few lines by following\nthe [instruction](https://github.com/lsds/KungFu#install). KungFu is also very fast and scalable, compared\nto Horovod and parameter servers, making it an attractive option for GAN networks.\n\nIn the following, we assume that you have added `kungfu-run` into the `$PATH`.\n\n(i) To run on a machine with 4 GPUs:\n\n```bash\nkungfu-run -np 4 python3 train.py --parallel --kf-optimizer=sma\n```\n\nThe default KungFu optimizer is `sma` which implements synchronous model averaging.\nThe `sma` decouple batch size and the number of GPUs, making it hyper-parameter-robust during scaling.\nYou can also use other KungFu optimizers: `sync-sgd` (which is the same as the DistributedOptimizer in Horovod)\nand `async-sgd` if you train your model in a cluster that has limited bandwidth and straggelers.\n\n(ii) To run on 2 machines (which have the nic `eth0` with IPs as `192.168.0.1` and `192.168.0.2`):\n\n```bash\nkungfu-run -np 8 -H 192.168.0.1:4,192.168.0.1:4 -nic eth0 python3 train.py --parallel --kf-optimizer=sma\n```\n\n## Results\n\n\u003ca href=\"https://join.slack.com/t/tensorlayer/shared_invite/enQtMjUyMjczMzU2Njg4LWI0MWU0MDFkOWY2YjQ4YjVhMzI5M2VlZmE4YTNhNGY1NjZhMzUwMmQ2MTc0YWRjMjQzMjdjMTg2MWQ2ZWJhYzc\"\u003e\n\u003cdiv align=\"center\"\u003e\n\t\u003cimg src=\"results/_sample_A.png\" width=\"80%\" height=\"50%\"/\u003e\n\u003c/div\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://join.slack.com/t/tensorlayer/shared_invite/enQtMjUyMjczMzU2Njg4LWI0MWU0MDFkOWY2YjQ4YjVhMzI5M2VlZmE4YTNhNGY1NjZhMzUwMmQ2MTc0YWRjMjQzMjdjMTg2MWQ2ZWJhYzc\"\u003e\n\u003cdiv align=\"center\"\u003e\n        \u003cimg src=\"results/199_a2b.png\" width=\"80%\" height=\"50%\"/\u003e\n\u003c/div\u003e\n\u003c/a\u003e\n\n\n## Author\n- @zsdonghao\n- @luomai\n\n### Discussion\n\n- [TensorLayer Slack](https://join.slack.com/t/tensorlayer/shared_invite/enQtMjUyMjczMzU2Njg4LWI0MWU0MDFkOWY2YjQ4YjVhMzI5M2VlZmE4YTNhNGY1NjZhMzUwMmQ2MTc0YWRjMjQzMjdjMTg2MWQ2ZWJhYzc)\n- [TensorLayer WeChat](https://github.com/tensorlayer/tensorlayer-chinese/blob/master/docs/wechat_group.md)\n\n### License\n\n- For academic and non-commercial use only.\n- For commercial use, please contact tensorlayer@gmail.com.\n","funding_links":[],"categories":["4. GAN"],"sub_categories":["1.2 DatasetAPI and TFRecord Examples"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftensorlayer%2Fcyclegan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftensorlayer%2Fcyclegan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftensorlayer%2Fcyclegan/lists"}