Skip to content

Commit 63e631d

Browse files
Imagen cherry pick from develop (#980)
* fix imagen training bug (#966) * fix imagen training bug * modify resolution * modify resolution Co-authored-by: Liujie0926 <44688141+Liujie0926@users.noreply.github.com> * fix imagen training bug (#966) * fix imagen training bug * modify resolution * modify resolution Co-authored-by: Liujie0926 <44688141+Liujie0926@users.noreply.github.com> Co-authored-by: Liujie0926 <44688141+Liujie0926@users.noreply.github.com>
1 parent 4779491 commit 63e631d

9 files changed

Lines changed: 75 additions & 11 deletions

ppfleetx/configs/multimodal/imagen/imagen_base.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ Data:
3535
Train:
3636
dataset:
3737
name: ImagenDataset
38-
input_path: ./data/cc12m_base64.lst
38+
input_path: ./projects/imagen/filelist/cc12m_base64.lst
3939
shuffle: True
40-
input_resolusion: 64
40+
input_resolution: 64
4141
max_seq_len: 128
4242
loader:
4343
num_workers: 8

ppfleetx/configs/multimodal/imagen/imagen_super_resolusion_1024.yaml renamed to ppfleetx/configs/multimodal/imagen/imagen_super_resolution_1024.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Data:
3232
name: ImagenDataset
3333
input_path: ./data/cc12m_base64.lst
3434
shuffle: True
35-
input_resolusion: 1024
35+
input_resolution: 1024
3636
max_seq_len: 128
3737
loader:
3838
num_workers: 8

ppfleetx/configs/multimodal/imagen/imagen_super_resolusion_256.yaml renamed to ppfleetx/configs/multimodal/imagen/imagen_super_resolution_256.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Data:
3232
name: ImagenDataset
3333
input_path: ./data/cc12m_base64.lst
3434
shuffle: True
35-
input_resolusion: 256
35+
input_resolution: 256
3636
max_seq_len: 128
3737
loader:
3838
num_workers: 8

ppfleetx/configs/multimodal/imagen/imagen_super_resolusion_512.yaml renamed to ppfleetx/configs/multimodal/imagen/imagen_super_resolution_512.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Data:
3232
name: ImagenDataset
3333
input_path: ./data/cc12m_base64.lst
3434
shuffle: True
35-
input_resolusion: 512
35+
input_resolution: 512
3636
max_seq_len: 128
3737
loader:
3838
num_workers: 8

ppfleetx/data/dataset/multimodal_dataset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(self,
9898
input_path,
9999
input_format='embed_base64_cc12m',
100100
shuffle=False,
101-
input_resolusion=64,
101+
input_resolution=64,
102102
second_size=256,
103103
max_seq_len=128,
104104
filter_image_resolution=128,
@@ -109,7 +109,7 @@ def __init__(self,
109109
self.filename = get_files(
110110
input_path, gpu_num=device_world_size, shuffle=shuffle)
111111
self.filter_image_resolution = filter_image_resolution
112-
self.input_resolusion = input_resolusion
112+
self.input_resolution = input_resolution
113113
self.max_seq_len = max_seq_len
114114
self.split = split
115115
if not isinstance(self.filename, list):
@@ -170,7 +170,7 @@ def __getitem__(self, index):
170170
text_embed = self.load_file(data_dir, data[1])
171171
attn_mask = self.load_file(data_dir, data[2])
172172
image = self.base64_to_image(data[3])
173-
image = data_augmentation_for_imagen(image, self.input_resolusion)
173+
image = data_augmentation_for_imagen(image, self.input_resolution)
174174

175175
return image, paddle.to_tensor(
176176
text_embed, dtype='float32'), paddle.to_tensor(
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
cc12m_base64/part-0
2+
cc12m_base64/part-1
3+
cc12m_base64/part-2
4+
cc12m_base64/part-3
5+
cc12m_base64/part-4
6+
cc12m_base64/part-5
7+
cc12m_base64/part-6
8+
cc12m_base64/part-7
9+
cc12m_base64/part-0
10+
cc12m_base64/part-1
11+
cc12m_base64/part-2
12+
cc12m_base64/part-3
13+
cc12m_base64/part-4
14+
cc12m_base64/part-5
15+
cc12m_base64/part-6
16+
cc12m_base64/part-7
17+
cc12m_base64/part-0
18+
cc12m_base64/part-1
19+
cc12m_base64/part-2
20+
cc12m_base64/part-3
21+
cc12m_base64/part-4
22+
cc12m_base64/part-5
23+
cc12m_base64/part-6
24+
cc12m_base64/part-7
25+
cc12m_base64/part-0
26+
cc12m_base64/part-1
27+
cc12m_base64/part-2
28+
cc12m_base64/part-3
29+
cc12m_base64/part-4
30+
cc12m_base64/part-5
31+
cc12m_base64/part-6
32+
cc12m_base64/part-7
33+
cc12m_base64/part-0
34+
cc12m_base64/part-1
35+
cc12m_base64/part-2
36+
cc12m_base64/part-3
37+
cc12m_base64/part-4
38+
cc12m_base64/part-5
39+
cc12m_base64/part-6
40+
cc12m_base64/part-7
41+
cc12m_base64/part-0
42+
cc12m_base64/part-1
43+
cc12m_base64/part-2
44+
cc12m_base64/part-3
45+
cc12m_base64/part-4
46+
cc12m_base64/part-5
47+
cc12m_base64/part-6
48+
cc12m_base64/part-7
49+
cc12m_base64/part-0
50+
cc12m_base64/part-1
51+
cc12m_base64/part-2
52+
cc12m_base64/part-3
53+
cc12m_base64/part-4
54+
cc12m_base64/part-5
55+
cc12m_base64/part-6
56+
cc12m_base64/part-7
57+
cc12m_base64/part-0
58+
cc12m_base64/part-1
59+
cc12m_base64/part-2
60+
cc12m_base64/part-3
61+
cc12m_base64/part-4
62+
cc12m_base64/part-5
63+
cc12m_base64/part-6
64+
cc12m_base64/part-7

projects/imagen/run_super_resolusion_1024_single.sh renamed to projects/imagen/run_super_resolution_1024_single.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
# limitations under the License.
1616

1717
export CUDA_VISIBLE_DEVICES=0
18-
python3 tools/train.py -c ppfleetx/configs/multimodal/imagen/imagen_super_resolusion_1024.yaml -o Data.Train.loader.num_workers=0
18+
python3 tools/train.py -c ppfleetx/configs/multimodal/imagen/imagen_super_resolution_1024.yaml -o Data.Train.loader.num_workers=0

projects/imagen/run_super_resolusion_512_single.sh renamed to projects/imagen/run_super_resolution_512_single.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
# limitations under the License.
1616

1717
export CUDA_VISIBLE_DEVICES=0
18-
python3 tools/train.py -c ppfleetx/configs/multimodal/imagen/imagen_super_resolusion_512.yaml -o Data.Train.loader.num_workers=8
18+
python3 tools/train.py -c ppfleetx/configs/multimodal/imagen/imagen_super_resolution_512.yaml -o Data.Train.loader.num_workers=8

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ pybind11==2.10.0
88
numpy==1.21.6
99
paddleslim>=2.4.0rc
1010
opencv-python==4.2.0.32
11-
Pillow==9.0.1
11+
Pillow==9.3.0
1212
blobfile==1.3.3
1313
paddlenlp>=2.4.3

0 commit comments

Comments
 (0)