以下是使用 Keras 的 Keras CycleGAN 示例中的 CycleGAN 示例 。
这是我修改后的使用多个 GPU 的实现。为了实现自定义训练,我使用了带有 tf.distribute.Strategy 的参考自定义训练
我想要一个来自 Keras 的 CycleGAN 示例,以便使用 GPU 快速运行。此外,我需要处理和训练大量数据。CycleGAN 使用多个损失函数train_step会返回 4 种损失,目前我只返回一种以便于理解。尽管如此,GPU 上的训练还是非常慢。我无法找到这背后的原因。
难道是我用tf.distribute.Strategy错了?
"""
Title: CycleGAN
Author: [A_K_Nain](https://twitter.com/A_K_Nain)
Date created: 2020/08/12
Last modified: 2020/08/12
Description: Implementation of CycleGAN.
"""
"""
## CycleGAN
CycleGAN is a model that aims to solve the image-to-image translation
problem. The goal of the image-to-image translation problem is to learn the
mapping between an input image and an …Run Code Online (Sandbox Code Playgroud) parallel-processing multi-gpu keras tensorflow generative-adversarial-network