From 301afd103e45d935201ecec564abe2bfcbb438c0 Mon Sep 17 00:00:00 2001 From: LielinJiang <50691816+LielinJiang@users.noreply.github.com> Date: Fri, 26 Feb 2021 22:22:09 +0800 Subject: [PATCH] fix bugs and update docs (#187) (#188) --- configs/animeganv2_pretrain.yaml | 29 +++++++++++++++-------------- configs/ugatit_photo2cartoon.yaml | 2 +- docs/en_US/tutorials/animegan.md | 2 +- docs/zh_CN/tutorials/animegan.md | 2 +- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/configs/animeganv2_pretrain.yaml b/configs/animeganv2_pretrain.yaml index 8098e6a..3e42197 100644 --- a/configs/animeganv2_pretrain.yaml +++ b/configs/animeganv2_pretrain.yaml @@ -42,20 +42,21 @@ dataset: test: name: SingleDataset dataroot: data/animedataset/test/test_photo - max_dataset_size: inf - direction: BtoA - input_nc: 3 - output_nc: 3 - serial_batches: False - pool_size: 50 - transforms: - - name: Resize - size: [256, 256] - interpolation: "bicubic" #cv2.INTER_CUBIC - - name: Transpose - - name: Normalize - mean: [127.5, 127.5, 127.5] - std: [127.5, 127.5, 127.5] + preprocess: + - name: LoadImageFromFile + key: A + - name: Transforms + input_keys: [A] + pipeline: + - name: ResizeToScale + size: [256, 256] + scale: 32 + interpolation: bilinear + - name: Transpose + - name: Normalize + mean: [127.5, 127.5, 127.5] + std: [127.5, 127.5, 127.5] + keys: [image, image] lr_scheduler: name: LinearDecay diff --git a/configs/ugatit_photo2cartoon.yaml b/configs/ugatit_photo2cartoon.yaml index 689dde7..6c2fc65 100644 --- a/configs/ugatit_photo2cartoon.yaml +++ b/configs/ugatit_photo2cartoon.yaml @@ -78,7 +78,7 @@ dataset: key: A - name: LoadImageFromFile key: B - - name: Transfroms + - name: Transforms input_keys: [A, B] pipeline: - name: Resize diff --git a/docs/en_US/tutorials/animegan.md b/docs/en_US/tutorials/animegan.md index 38aaaf3..d216719 100644 --- a/docs/en_US/tutorials/animegan.md +++ b/docs/en_US/tutorials/animegan.md @@ -70,7 +70,7 @@ animedataset 2. After the warmup, we strat to training GAN.: **NOTE:** you must modify the `configs/animeganv2.yaml > pretrain_ckpt ` parameter first! ensure the GAN can reuse the warmup generator model. - Set the `batch size=4` and the `learning rate=0.00002`. Train 30 epochs on a GTX2060S GPU to reproduce the result. For other hyperparameters, please refer to `configs/animeganv2.yaml`. + Set the `batch size=4` and the `learning rate=0.0002`. Train 30 epochs on a GTX2060S GPU to reproduce the result. For other hyperparameters, please refer to `configs/animeganv2.yaml`. ```sh python tools/main.py --config-file configs/animeganv2.yaml ``` diff --git a/docs/zh_CN/tutorials/animegan.md b/docs/zh_CN/tutorials/animegan.md index bc3d5aa..3c86bec 100644 --- a/docs/zh_CN/tutorials/animegan.md +++ b/docs/zh_CN/tutorials/animegan.md @@ -70,7 +70,7 @@ animedataset 1. 预热模型完成后,训练风格迁移模型: **注意:** 必须先修改在`configs/animeganv2.yaml`中的`pretrain_ckpt`参数,确保指向正确的 **预热模型权重路径** - 设置`batch size=4`,`learning rate=0.00002`,在一个 GTX2060S GPU上训练30个epoch即可获得较好的效果,其他超参数请参考`configs/animeganv2.yaml`。 + 设置`batch size=4`,`learning rate=0.0002`,在一个 GTX2060S GPU上训练30个epoch即可获得较好的效果,其他超参数请参考`configs/animeganv2.yaml`。 ```sh python tools/main.py --config-file configs/animeganv2.yaml -- GitLab