未验证 提交 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
* [Photo2Cartoon](./docs/en_US/tutorials/photo2cartoon.md)
* [Wav2Lip](./docs/en_US/tutorials/wav2lip.md)
* [Super_Resolution](./docs/en_US/tutorials/super_resolution.md)
* [StyleGAN2](./docs/en_US/tutorials/styleganv2.md)
## Composite Application
......
......@@ -46,6 +46,8 @@ GAN--生成对抗网络,被“卷积网络之父”**Yann LeCun(杨立昆)
* [Photo2Cartoon](docs/zh_CN/tutorials/photo2cartoon.md)
* [Wav2Lip](docs/zh_CN/tutorials/wav2lip.md)
* [Super_Resolution](./docs/en_US/tutorials/super_resolution.md)
* [StyleGAN2](./docs/en_US/tutorials/styleganv2.md)
## 复合应用
......
......@@ -18,8 +18,8 @@ model:
dataset:
train:
name: SRDataset
gt_folder: data/DIV2K/DIV2K_train_HR
lq_folder: data/DIV2K/DIV2K_train_LR_bicubic/X4
gt_folder: data/DIV2K/DIV2K_train_HR_sub
lq_folder: data/DIV2K/DIV2K_train_LR_bicubic/X4_sub
num_workers: 4
batch_size: 16
scale: 4
......
......@@ -64,7 +64,10 @@ dataset:
preprocess:
- name: LoadImageFromFile
key: pair
- name: Transforms
- name: SplitPairedImage
key: pair
paired_keys: [A, B]
- name: Transforms
input_keys: [A, B]
pipeline:
- name: Resize
......
......@@ -51,8 +51,26 @@
```
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.
Unzip Corrupted-tr-x.zip and Corrupted-tr-y.zip to ``PaddleGAN/data/ntire20`` directory.
......
......@@ -144,9 +144,9 @@ class Trainer:
self.best_metric = {}
def distributed_data_parallel(self):
strategy = paddle.distributed.prepare_context()
paddle.distributed.init_parallel_env()
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):
if isinstance(self.model.lr_scheduler, dict):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册