未验证 提交 09ab2ba7 编写于 作者: L LielinJiang 提交者: GitHub

[cherry pick 2.0-beta] some bug fix commit from develop to 2.0-beta (#162)

* fix distributed bug (#160)

* update docs configs (#161)
上级 438deb1d
...@@ -45,6 +45,8 @@ GAN-Generative Adversarial Network, was praised by "the Father of Convolutional ...@@ -45,6 +45,8 @@ GAN-Generative Adversarial Network, was praised by "the Father of Convolutional
* [Photo2Cartoon](./docs/en_US/tutorials/photo2cartoon.md) * [Photo2Cartoon](./docs/en_US/tutorials/photo2cartoon.md)
* [Wav2Lip](./docs/en_US/tutorials/wav2lip.md) * [Wav2Lip](./docs/en_US/tutorials/wav2lip.md)
* [Super_Resolution](./docs/en_US/tutorials/super_resolution.md) * [Super_Resolution](./docs/en_US/tutorials/super_resolution.md)
* [StyleGAN2](./docs/en_US/tutorials/styleganv2.md)
## Composite Application ## Composite Application
......
...@@ -46,6 +46,8 @@ GAN--生成对抗网络,被“卷积网络之父”**Yann LeCun(杨立昆) ...@@ -46,6 +46,8 @@ GAN--生成对抗网络,被“卷积网络之父”**Yann LeCun(杨立昆)
* [Photo2Cartoon](docs/zh_CN/tutorials/photo2cartoon.md) * [Photo2Cartoon](docs/zh_CN/tutorials/photo2cartoon.md)
* [Wav2Lip](docs/zh_CN/tutorials/wav2lip.md) * [Wav2Lip](docs/zh_CN/tutorials/wav2lip.md)
* [Super_Resolution](./docs/en_US/tutorials/super_resolution.md) * [Super_Resolution](./docs/en_US/tutorials/super_resolution.md)
* [StyleGAN2](./docs/en_US/tutorials/styleganv2.md)
## 复合应用 ## 复合应用
......
...@@ -18,8 +18,8 @@ model: ...@@ -18,8 +18,8 @@ model:
dataset: dataset:
train: train:
name: SRDataset name: SRDataset
gt_folder: data/DIV2K/DIV2K_train_HR gt_folder: data/DIV2K/DIV2K_train_HR_sub
lq_folder: data/DIV2K/DIV2K_train_LR_bicubic/X4 lq_folder: data/DIV2K/DIV2K_train_LR_bicubic/X4_sub
num_workers: 4 num_workers: 4
batch_size: 16 batch_size: 16
scale: 4 scale: 4
......
...@@ -64,7 +64,10 @@ dataset: ...@@ -64,7 +64,10 @@ dataset:
preprocess: preprocess:
- name: LoadImageFromFile - name: LoadImageFromFile
key: pair key: pair
- name: Transforms - name: SplitPairedImage
key: pair
paired_keys: [A, B]
- name: Transforms
input_keys: [A, B] input_keys: [A, B]
pipeline: pipeline:
- name: Resize - name: Resize
......
...@@ -51,8 +51,26 @@ ...@@ -51,8 +51,26 @@
``` ```
python data/process_div2k_data.py --data-root data/DIV2K python data/process_div2k_data.py --data-root data/DIV2K
``` ```
When the program is finished, check whether there are ``DIV2K_train_HR_sub``, ``X2_sub``, ``X3_sub`` and ``X4_sub`` directories in the DIV2K directory
```
PaddleGAN
├── data
├── DIV2K
├── DIV2K_train_HR
├── DIV2K_train_HR_sub
├── DIV2K_train_LR_bicubic
| ├──X2
| ├──X2_sub
| ├──X3
| ├──X3_sub
| ├──sX4
| └──X4_sub
├── DIV2K_valid_HR
├── DIV2K_valid_LR_bicubic
...
```
Prepare dataset for realsr df2k model: #### Prepare dataset for realsr df2k model
Download dataset from [NTIRE 2020 RWSR](https://competitions.codalab.org/competitions/22220#participate) and unzip it to your path. Download dataset from [NTIRE 2020 RWSR](https://competitions.codalab.org/competitions/22220#participate) and unzip it to your path.
Unzip Corrupted-tr-x.zip and Corrupted-tr-y.zip to ``PaddleGAN/data/ntire20`` directory. Unzip Corrupted-tr-x.zip and Corrupted-tr-y.zip to ``PaddleGAN/data/ntire20`` directory.
......
...@@ -144,9 +144,9 @@ class Trainer: ...@@ -144,9 +144,9 @@ class Trainer:
self.best_metric = {} self.best_metric = {}
def distributed_data_parallel(self): def distributed_data_parallel(self):
strategy = paddle.distributed.prepare_context() paddle.distributed.init_parallel_env()
for net_name, net in self.model.nets.items(): for net_name, net in self.model.nets.items():
self.model.nets[net_name] = paddle.DataParallel(net, strategy) self.model.nets[net_name] = paddle.DataParallel(net)
def learning_rate_scheduler_step(self): def learning_rate_scheduler_step(self):
if isinstance(self.model.lr_scheduler, dict): if isinstance(self.model.lr_scheduler, dict):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册