{"id":13698613,"url":"https://github.com/hollygrimm/tf2-cyclegan","last_synced_at":"2026-02-19T00:25:44.865Z","repository":{"id":55638089,"uuid":"196049039","full_name":"hollygrimm/tf2-cyclegan","owner":"hollygrimm","description":"CycleGAN on Tensorflow 2.0","archived":false,"fork":false,"pushed_at":"2019-07-24T14:52:00.000Z","size":6136,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-13T03:34:46.843Z","etag":null,"topics":["cyclegan","machine-learning","python","tensorflow","tensorflow2","tf2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hollygrimm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-09T16:53:07.000Z","updated_at":"2022-08-10T01:53:01.000Z","dependencies_parsed_at":"2022-08-15T05:10:29.992Z","dependency_job_id":null,"html_url":"https://github.com/hollygrimm/tf2-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/hollygrimm%2Ftf2-cyclegan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollygrimm%2Ftf2-cyclegan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollygrimm%2Ftf2-cyclegan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollygrimm%2Ftf2-cyclegan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hollygrimm","download_url":"https://codeload.github.com/hollygrimm/tf2-cyclegan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252283624,"owners_count":21723511,"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":["cyclegan","machine-learning","python","tensorflow","tensorflow2","tf2"],"created_at":"2024-08-02T19:00:50.896Z","updated_at":"2026-02-19T00:25:39.844Z","avatar_url":"https://github.com/hollygrimm.png","language":"Python","funding_links":[],"categories":["Model 💛💛💛💛💛\u003ca name=\"Model\" /\u003e"],"sub_categories":["Classification 分类"],"readme":"# Tensorflow2 CycleGAN\nConverted Jupyter Notebook https://www.tensorflow.org/beta/tutorials/generative/cyclegan to Python \n\n## Requirements\n* tensorflow 2.0.0-beta1\n* tensorflow_datasets (horses to zebra dataset)\n* tensorflow_examples (pix2pix model)\n* jupyter (for visualization in notebooks)\n* matplotlib (for visualization in notebooks)\n\n\n## AWS Install\nInstructions below for an AWS p2.xlarge with Deep Learning AMI (Ubuntu 16.04) Version 21.2.\n\nSelect CUDA version 10.0\n```\nsudo rm /usr/local/cuda\nsudo ln -s /usr/local/cuda-10.0 /usr/local/cuda\n```\nFind the appropriate Linux driver version for CUDA 10.0: https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html\n\nUpdate CUDA driver \u003e= 410.48 (from https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-nvidia-driver.html)\n```\nsudo apt-get update -y\nsudo apt-get upgrade -y linux-aws\nsudo reboot\nsudo apt-get install -y gcc make linux-headers-$(uname -r)\n```\n\n```\ncat \u003c\u003c EOF | sudo tee --append /etc/modprobe.d/blacklist.conf\nblacklist vga16fb\nblacklist nouveau\nblacklist rivafb\nblacklist nvidiafb\nblacklist rivatv\nEOF\n```\n```\nvi /etc/default/grub\n```\nadd following line to grub\n```\nGRUB_CMDLINE_LINUX=\"rdblacklist=nouveau\"\n```\n\nFind correct version of driver https://www.nvidia.com/Download/Find.aspx by selecting Tesla K80, Ubuntu 16.04, CUDA 10.0 and modify version in download path below.\n\n```\nsudo update-grub\ncd /tmp\nwget http://us.download.nvidia.com/tesla/410.104/NVIDIA-Linux-x86_64-410.104.run\nsudo /bin/sh ./NVIDIA-Linux-x86_64-410.104.run\n```\naccept all defaults on install (DKMS will fail if you select it)\n\n```\nsudo reboot\n```\n\n```\nnvidia-smi -q | head\n```\n\n\n## Conda Install\n```\nconda create -n tf2_p37 python=3.7\nconda install -n tf2_p37 pip\nsource activate tf2_p37\npip install tensorflow-gpu==2.0.0-beta1\npip install --upgrade pip\npip install tensorflow_datasets\npip install jupyter\npip install matplotlib\npip install imageio\npip install -q git+https://github.com/tensorflow/examples.git\n```\n\nTest Install\n```\nimport tensorflow as tf\nassert tf.test.is_gpu_available()\nassert tf.test.is_built_with_cuda()\n```\n\n### Download Dataset\nwhen training is run, tensorflow_datasets downloads the cycle_gan dataset (111.45 MiB) to /home/ubuntu/tensorflow_datasets/cycle_gan/horse2zebra/0.1.0\n \n\n## input_params.json Configuration\n- `exp_name`: description of experiment\n- `gan_mode`: either `gan`, `lsgan` Not yet supported: `wgan`, `hinge`\n- `gradient_penalty_mode`: either `none`, `dragan`, `wgan-gp` (Not yet supported)\n- `batch_size`: integer batch size appropriate for your GPU size \n- `nb_epoch`: integer number of epochs\n\n## Run Training\n```\nsource activate tf2_p37\ncd tf2-cyclegan/\npython main.py -c input_params.json\n```\n\n## Tensorboard\n```\nsource activate tf2_p37\ncd tf2-cyclegan/experiments/\ntensorboard --logdir=.\n```\n\n## Run Inference on Test Samples\nUpdate trained_checkpoint_dir:\n```\nvi input_params_predict.json\n```\n\nRun inference:\n```\nsource activate tf2_p37\ncd tf2-cyclegan/\npython predict.py -c input_params_predict.json\n```\n\n## Run Tests\nTODO","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhollygrimm%2Ftf2-cyclegan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhollygrimm%2Ftf2-cyclegan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhollygrimm%2Ftf2-cyclegan/lists"}