2512
Browse files- dataset.py +5 -5
- samples/unet_384x768_0.jpg +2 -2
- samples/unet_416x768_0.jpg +2 -2
- samples/unet_448x768_0.jpg +2 -2
- samples/unet_480x768_0.jpg +2 -2
- samples/unet_512x768_0.jpg +2 -2
- samples/unet_544x768_0.jpg +2 -2
- samples/unet_576x768_0.jpg +2 -2
- samples/unet_608x768_0.jpg +2 -2
- samples/unet_640x768_0.jpg +2 -2
- samples/unet_672x768_0.jpg +2 -2
- samples/unet_704x768_0.jpg +2 -2
- samples/unet_736x768_0.jpg +2 -2
- samples/unet_768x384_0.jpg +2 -2
- samples/unet_768x416_0.jpg +2 -2
- samples/unet_768x448_0.jpg +2 -2
- samples/unet_768x480_0.jpg +2 -2
- samples/unet_768x512_0.jpg +2 -2
- samples/unet_768x544_0.jpg +2 -2
- samples/unet_768x576_0.jpg +2 -2
- samples/unet_768x608_0.jpg +2 -2
- samples/unet_768x640_0.jpg +2 -2
- samples/unet_768x672_0.jpg +2 -2
- samples/unet_768x704_0.jpg +2 -2
- samples/unet_768x736_0.jpg +2 -2
- samples/unet_768x768_0.jpg +2 -2
- src/sdxs_create.ipynb +2 -2
- src/sdxs_create_05.ipynb +3 -0
- train.py +7 -7
- unet/config.json +2 -2
- unet/diffusion_pytorch_model.safetensors +2 -2
dataset.py
CHANGED
|
@@ -21,14 +21,14 @@ from datetime import timedelta
|
|
| 21 |
dtype = torch.float32
|
| 22 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 23 |
batch_size = 5
|
| 24 |
-
min_size = 384 #320 #192 #256 #192
|
| 25 |
-
max_size = 768 #640 #384 #256 #384
|
| 26 |
-
step =
|
| 27 |
empty_share = 0.0
|
| 28 |
limit = 0
|
| 29 |
# Основная процедура обработки
|
| 30 |
-
folder_path = "/workspace/
|
| 31 |
-
save_path = "/workspace/sdxs/datasets/
|
| 32 |
os.makedirs(save_path, exist_ok=True)
|
| 33 |
|
| 34 |
# Функция для очистки CUDA памяти
|
|
|
|
| 21 |
dtype = torch.float32
|
| 22 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 23 |
batch_size = 5
|
| 24 |
+
min_size = 192 #384 #320 #192 #256 #192
|
| 25 |
+
max_size = 320 #768 #640 #384 #256 #384
|
| 26 |
+
step = 64 #64
|
| 27 |
empty_share = 0.0
|
| 28 |
limit = 0
|
| 29 |
# Основная процедура обработки
|
| 30 |
+
folder_path = "/workspace/butterfly" #alchemist"
|
| 31 |
+
save_path = "/workspace/sdxs/datasets/butterfly" #"alchemist"
|
| 32 |
os.makedirs(save_path, exist_ok=True)
|
| 33 |
|
| 34 |
# Функция для очистки CUDA памяти
|
samples/unet_384x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_416x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_448x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_480x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_512x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_544x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_576x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_608x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_640x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_672x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_704x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_736x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x384_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x416_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x448_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x480_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x512_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x544_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x576_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x608_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x640_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x672_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x704_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x736_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
src/sdxs_create.ipynb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f7e7a0f7dec0f14e09690f5c4cf83505b42361436f3eec7a0edfb3c6ccf3bf91
|
| 3 |
+
size 37958
|
src/sdxs_create_05.ipynb
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c170b5c6e418e9d7e94bf475aff653bde77a1b852db94b8254beaeef8a36d9ce
|
| 3 |
+
size 37749
|
train.py
CHANGED
|
@@ -29,10 +29,10 @@ from transformers import AutoTokenizer, AutoModel
|
|
| 29 |
# --------------------------- Параметры ---------------------------
|
| 30 |
ds_path = "/workspace/sdxs/datasets/768"
|
| 31 |
project = "unet"
|
| 32 |
-
batch_size =
|
| 33 |
-
base_learning_rate = 2.7e-5
|
| 34 |
-
min_learning_rate =
|
| 35 |
-
num_epochs =
|
| 36 |
sample_interval_share = 5
|
| 37 |
max_length = 192
|
| 38 |
use_wandb = True
|
|
@@ -651,7 +651,7 @@ for epoch in range(start_epoch, start_epoch + num_epochs):
|
|
| 651 |
|
| 652 |
for step, (latents, embeddings, attention_mask) in enumerate(dataloader):
|
| 653 |
with accelerator.accumulate(unet):
|
| 654 |
-
if save_model == False and step == 5 :
|
| 655 |
used_gb = torch.cuda.max_memory_allocated() / 1024**3
|
| 656 |
print(f"Шаг {step}: {used_gb:.2f} GB")
|
| 657 |
|
|
@@ -772,8 +772,8 @@ for epoch in range(start_epoch, start_epoch + num_epochs):
|
|
| 772 |
|
| 773 |
if accelerator.is_main_process:
|
| 774 |
print("Обучение завершено! Сохраняем финальную модель...")
|
| 775 |
-
if save_model:
|
| 776 |
-
|
| 777 |
if use_comet_ml:
|
| 778 |
comet_experiment.end()
|
| 779 |
accelerator.free_memory()
|
|
|
|
| 29 |
# --------------------------- Параметры ---------------------------
|
| 30 |
ds_path = "/workspace/sdxs/datasets/768"
|
| 31 |
project = "unet"
|
| 32 |
+
batch_size = 16
|
| 33 |
+
base_learning_rate = 2e-5 #2.7e-5
|
| 34 |
+
min_learning_rate = 2e-6 #2.7e-5
|
| 35 |
+
num_epochs = 10
|
| 36 |
sample_interval_share = 5
|
| 37 |
max_length = 192
|
| 38 |
use_wandb = True
|
|
|
|
| 651 |
|
| 652 |
for step, (latents, embeddings, attention_mask) in enumerate(dataloader):
|
| 653 |
with accelerator.accumulate(unet):
|
| 654 |
+
if save_model == False and epoch == 0 and step == 5 :
|
| 655 |
used_gb = torch.cuda.max_memory_allocated() / 1024**3
|
| 656 |
print(f"Шаг {step}: {used_gb:.2f} GB")
|
| 657 |
|
|
|
|
| 772 |
|
| 773 |
if accelerator.is_main_process:
|
| 774 |
print("Обучение завершено! Сохраняем финальную модель...")
|
| 775 |
+
#if save_model:
|
| 776 |
+
save_checkpoint(unet,"fp16")
|
| 777 |
if use_comet_ml:
|
| 778 |
comet_experiment.end()
|
| 779 |
accelerator.free_memory()
|
unet/config.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fb10c12478625b355068dbfce29e8db3c8a52d03e10508452e4feb5404545584
|
| 3 |
+
size 1876
|
unet/diffusion_pytorch_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5bd1bc9f4967f9060624d6d5536ed84fe051cd0203f5b26b083249093bd696d2
|
| 3 |
+
size 7444321360
|