From 14a8ae832f72c2d13f11c65af28a7958636c0d95 Mon Sep 17 00:00:00 2001 From: Dongsheng Li Date: Fri, 26 Feb 2021 23:17:29 +0800 Subject: [PATCH 1/6] Add files via upload New faceshq_transformer.yaml --- configs/faceshq_transformer.yaml | 84 ++++++++++++++++---------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/configs/faceshq_transformer.yaml b/configs/faceshq_transformer.yaml index b93391f9..14726469 100644 --- a/configs/faceshq_transformer.yaml +++ b/configs/faceshq_transformer.yaml @@ -1,61 +1,61 @@ model: base_learning_rate: 4.5e-06 - target: taming.models.cond_transformer.Net2NetTransformer - params: - cond_stage_key: coord - transformer_config: - target: taming.modules.transformer.mingpt.GPT - params: - vocab_size: 1024 - block_size: 512 - n_layer: 24 - n_head: 16 - n_embd: 1024 - first_stage_config: - target: taming.models.vqgan.VQModel - params: - ckpt_path: logs/2020-11-09T13-33-36_faceshq_vqgan/checkpoints/last.ckpt - embed_dim: 256 + params: + cond_stage_config: + params: + down_factor: 16 n_embed: 1024 - ddconfig: + target: taming.modules.misc.coord.CoordStage + cond_stage_key: coord + first_stage_config: + params: + ckpt_path: logs/2021-02-24T18-54-51_faceshq_vqgan/checkpoints/last.ckpt + ddconfig: + attn_resolutions: + - 16 + ch: 128 + ch_mult: + - 1 + - 1 + - 2 + - 2 + - 4 double_z: false - z_channels: 256 - resolution: 256 + dropout: 0.0 in_channels: 3 - out_ch: 3 - ch: 128 - ch_mult: - - 1 - - 1 - - 2 - - 2 - - 4 num_res_blocks: 2 - attn_resolutions: - - 16 - dropout: 0.0 - lossconfig: + out_ch: 3 + resolution: 256 + z_channels: 256 + embed_dim: 256 + lossconfig: target: taming.modules.losses.DummyLoss - cond_stage_config: - target: taming.modules.misc.coord.CoordStage - params: n_embed: 1024 - down_factor: 16 + target: taming.models.vqgan.VQModel + transformer_config: + params: + block_size: 512 + n_embd: 1024 + n_head: 16 + n_layer: 24 + vocab_size: 1024 + target: taming.modules.transformer.mingpt.GPT + target: taming.models.cond_transformer.Net2NetTransformer data: - target: main.DataModuleFromConfig params: batch_size: 2 num_workers: 8 train: - target: taming.data.faceshq.FacesHQTrain params: - size: 256 + coord: true crop_size: 256 - coord: True + size: 256 + target: taming.data.faceshq.FacesHQTrain validation: - target: taming.data.faceshq.FacesHQValidation params: - size: 256 + coord: true crop_size: 256 - coord: True + size: 256 + target: taming.data.faceshq.FacesHQValidation + target: main.DataModuleFromConfig \ No newline at end of file From c598de4443a59591cf3a4b0baa591c7742d06363 Mon Sep 17 00:00:00 2001 From: Dongsheng Li Date: Fri, 26 Feb 2021 23:20:03 +0800 Subject: [PATCH 2/6] Update README.md Add some tips for FacesHQ. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index c3a0b6ca..60ecd7ec 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,10 @@ Train a VQGAN with python main.py --base configs/faceshq_vqgan.yaml -t True --gpus 0, ``` +There are two classes in `taming/data/faceshq.py`. One called `CelebAHQ{split}` reads `.npy` files, the other called `FFHQ{split}` read images, +where `{split}` is one of `train`/`validation`. +In the same file, for class `FacesHQTrain` and `FacesHQValidation`, change `d1` or `d2` as the way you want to use. + Then, adjust the checkpoint path of the config key `model.params.first_stage_config.params.ckpt_path` in `configs/faceshq_transformer.yaml` (or download @@ -164,6 +168,10 @@ corresponds to the preconfigured checkpoint path), then run ``` python main.py --base configs/faceshq_transformer.yaml -t True --gpus 0, ``` +Run the code above will cause error: yaml.parser.ParserError: expected '', but found '' + +Solution: Change to new `configs/faceshq_transformer.yaml` + ### D-RIN From c23edd90a88ff60a914e9b85449e28fee9a78eb1 Mon Sep 17 00:00:00 2001 From: Dongsheng Li Date: Fri, 26 Feb 2021 23:21:11 +0800 Subject: [PATCH 3/6] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 60ecd7ec..0168ab18 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,7 @@ corresponds to the preconfigured checkpoint path), then run ``` python main.py --base configs/faceshq_transformer.yaml -t True --gpus 0, ``` + Run the code above will cause error: yaml.parser.ParserError: expected '', but found '' Solution: Change to new `configs/faceshq_transformer.yaml` From 2a39a1c849fa9c98a2643479736bd8b6a3135068 Mon Sep 17 00:00:00 2001 From: Dongsheng Li Date: Fri, 26 Feb 2021 23:22:04 +0800 Subject: [PATCH 4/6] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0168ab18..78361a5d 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,8 @@ corresponds to the preconfigured checkpoint path), then run python main.py --base configs/faceshq_transformer.yaml -t True --gpus 0, ``` -Run the code above will cause error: yaml.parser.ParserError: expected '', but found '' +Run the code above will cause error: yaml.parser.ParserError: +expected '', but found '' Solution: Change to new `configs/faceshq_transformer.yaml` From 2cf5a5daf5350b2b771924570ff80c40fa7805b6 Mon Sep 17 00:00:00 2001 From: Dongsheng Li Date: Fri, 26 Feb 2021 23:23:58 +0800 Subject: [PATCH 5/6] Update README.md Add some tips for FacesHQ --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 78361a5d..d77f3578 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ python main.py --base configs/faceshq_transformer.yaml -t True --gpus 0, ``` Run the code above will cause error: yaml.parser.ParserError: -expected '', but found '' +expected '\', but found '\' Solution: Change to new `configs/faceshq_transformer.yaml` From aef7d6cd0f418917fd48f3d0ccd815e3bc06c6b9 Mon Sep 17 00:00:00 2001 From: Dongsheng Li Date: Fri, 26 Feb 2021 23:28:10 +0800 Subject: [PATCH 6/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d77f3578..3b98a74e 100644 --- a/README.md +++ b/README.md @@ -157,8 +157,8 @@ python main.py --base configs/faceshq_vqgan.yaml -t True --gpus 0, ``` There are two classes in `taming/data/faceshq.py`. One called `CelebAHQ{split}` reads `.npy` files, the other called `FFHQ{split}` read images, -where `{split}` is one of `train`/`validation`. -In the same file, for class `FacesHQTrain` and `FacesHQValidation`, change `d1` or `d2` as the way you want to use. +where `{split}` is one of `Train`/`Validation`. +In the same file, for class `FacesHQTrain` and `FacesHQValidation`, change `d1` or `d2` as the way you want to use it. Then, adjust the checkpoint path of the config key `model.params.first_stage_config.params.ckpt_path` in