diff --git a/.gitignore b/.gitignore index 4bbe43a..e0bd1cc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ gen.bat gen_ref.bat train.bat +__pycache__ +*/**/__pycache__ +logs \ No newline at end of file diff --git a/configs/stable-diffusion/v1-finetune_unfrozen.yaml b/configs/stable-diffusion/v1-finetune_unfrozen.yaml index 276ce22..8240e22 100644 --- a/configs/stable-diffusion/v1-finetune_unfrozen.yaml +++ b/configs/stable-diffusion/v1-finetune_unfrozen.yaml @@ -77,7 +77,7 @@ data: target: main.DataModuleFromConfig params: batch_size: 1 - num_workers: 2 + num_workers: 1 wrap: false train: target: ldm.data.personalized.PersonalizedBase diff --git a/evaluation/__pycache__/clip_eval.cpython-36.pyc b/evaluation/__pycache__/clip_eval.cpython-36.pyc deleted file mode 100644 index d8f156d..0000000 Binary files a/evaluation/__pycache__/clip_eval.cpython-36.pyc and /dev/null differ diff --git a/evaluation/__pycache__/clip_eval.cpython-38.pyc b/evaluation/__pycache__/clip_eval.cpython-38.pyc deleted file mode 100644 index 890bb4e..0000000 Binary files a/evaluation/__pycache__/clip_eval.cpython-38.pyc and /dev/null differ diff --git a/ldm/__pycache__/util.cpython-36.pyc b/ldm/__pycache__/util.cpython-36.pyc deleted file mode 100644 index cd5ac82..0000000 Binary files a/ldm/__pycache__/util.cpython-36.pyc and /dev/null differ diff --git a/ldm/__pycache__/util.cpython-38.pyc b/ldm/__pycache__/util.cpython-38.pyc deleted file mode 100644 index 874c370..0000000 Binary files a/ldm/__pycache__/util.cpython-38.pyc and /dev/null differ diff --git a/ldm/data/__pycache__/__init__.cpython-36.pyc b/ldm/data/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index fa8037e..0000000 Binary files a/ldm/data/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/ldm/data/__pycache__/__init__.cpython-38.pyc b/ldm/data/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index c576f9d..0000000 Binary files a/ldm/data/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/ldm/data/__pycache__/base.cpython-36.pyc b/ldm/data/__pycache__/base.cpython-36.pyc deleted file mode 100644 index 62b31c2..0000000 Binary files a/ldm/data/__pycache__/base.cpython-36.pyc and /dev/null differ diff --git a/ldm/data/__pycache__/base.cpython-38.pyc b/ldm/data/__pycache__/base.cpython-38.pyc deleted file mode 100644 index 47ff11c..0000000 Binary files a/ldm/data/__pycache__/base.cpython-38.pyc and /dev/null differ diff --git a/ldm/data/__pycache__/personalized.cpython-36.pyc b/ldm/data/__pycache__/personalized.cpython-36.pyc deleted file mode 100644 index dbc3856..0000000 Binary files a/ldm/data/__pycache__/personalized.cpython-36.pyc and /dev/null differ diff --git a/ldm/data/__pycache__/personalized.cpython-38.pyc b/ldm/data/__pycache__/personalized.cpython-38.pyc deleted file mode 100644 index 4dac448..0000000 Binary files a/ldm/data/__pycache__/personalized.cpython-38.pyc and /dev/null differ diff --git a/ldm/data/__pycache__/personalized_compose.cpython-38.pyc b/ldm/data/__pycache__/personalized_compose.cpython-38.pyc deleted file mode 100644 index 41adc50..0000000 Binary files a/ldm/data/__pycache__/personalized_compose.cpython-38.pyc and /dev/null differ diff --git a/ldm/data/__pycache__/personalized_detailed_text.cpython-36.pyc b/ldm/data/__pycache__/personalized_detailed_text.cpython-36.pyc deleted file mode 100644 index 40586e1..0000000 Binary files a/ldm/data/__pycache__/personalized_detailed_text.cpython-36.pyc and /dev/null differ diff --git a/ldm/data/__pycache__/personalized_style.cpython-36.pyc b/ldm/data/__pycache__/personalized_style.cpython-36.pyc deleted file mode 100644 index 58daf2a..0000000 Binary files a/ldm/data/__pycache__/personalized_style.cpython-36.pyc and /dev/null differ diff --git a/ldm/data/__pycache__/personalized_style.cpython-38.pyc b/ldm/data/__pycache__/personalized_style.cpython-38.pyc deleted file mode 100644 index 919d42f..0000000 Binary files a/ldm/data/__pycache__/personalized_style.cpython-38.pyc and /dev/null differ diff --git a/ldm/models/__pycache__/autoencoder.cpython-36.pyc b/ldm/models/__pycache__/autoencoder.cpython-36.pyc deleted file mode 100644 index 3ee1d08..0000000 Binary files a/ldm/models/__pycache__/autoencoder.cpython-36.pyc and /dev/null differ diff --git a/ldm/models/__pycache__/autoencoder.cpython-38.pyc b/ldm/models/__pycache__/autoencoder.cpython-38.pyc deleted file mode 100644 index 7a2b263..0000000 Binary files a/ldm/models/__pycache__/autoencoder.cpython-38.pyc and /dev/null differ diff --git a/ldm/models/diffusion/__pycache__/__init__.cpython-36.pyc b/ldm/models/diffusion/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 5fa5d9e..0000000 Binary files a/ldm/models/diffusion/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/ldm/models/diffusion/__pycache__/__init__.cpython-38.pyc b/ldm/models/diffusion/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index fac69f7..0000000 Binary files a/ldm/models/diffusion/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/ldm/models/diffusion/__pycache__/ddim.cpython-36.pyc b/ldm/models/diffusion/__pycache__/ddim.cpython-36.pyc deleted file mode 100644 index ae85930..0000000 Binary files a/ldm/models/diffusion/__pycache__/ddim.cpython-36.pyc and /dev/null differ diff --git a/ldm/models/diffusion/__pycache__/ddim.cpython-38.pyc b/ldm/models/diffusion/__pycache__/ddim.cpython-38.pyc deleted file mode 100644 index 3581d48..0000000 Binary files a/ldm/models/diffusion/__pycache__/ddim.cpython-38.pyc and /dev/null differ diff --git a/ldm/models/diffusion/__pycache__/ddim_inversion.cpython-38.pyc b/ldm/models/diffusion/__pycache__/ddim_inversion.cpython-38.pyc deleted file mode 100644 index 7134101..0000000 Binary files a/ldm/models/diffusion/__pycache__/ddim_inversion.cpython-38.pyc and /dev/null differ diff --git a/ldm/models/diffusion/__pycache__/ddpm.cpython-36.pyc b/ldm/models/diffusion/__pycache__/ddpm.cpython-36.pyc deleted file mode 100644 index 8d7e689..0000000 Binary files a/ldm/models/diffusion/__pycache__/ddpm.cpython-36.pyc and /dev/null differ diff --git a/ldm/models/diffusion/__pycache__/ddpm.cpython-38.pyc b/ldm/models/diffusion/__pycache__/ddpm.cpython-38.pyc deleted file mode 100644 index 6bb4def..0000000 Binary files a/ldm/models/diffusion/__pycache__/ddpm.cpython-38.pyc and /dev/null differ diff --git a/ldm/models/diffusion/__pycache__/ddpm_pti.cpython-38.pyc b/ldm/models/diffusion/__pycache__/ddpm_pti.cpython-38.pyc deleted file mode 100644 index 57b7785..0000000 Binary files a/ldm/models/diffusion/__pycache__/ddpm_pti.cpython-38.pyc and /dev/null differ diff --git a/ldm/models/diffusion/__pycache__/plms.cpython-36.pyc b/ldm/models/diffusion/__pycache__/plms.cpython-36.pyc deleted file mode 100644 index f04c88a..0000000 Binary files a/ldm/models/diffusion/__pycache__/plms.cpython-36.pyc and /dev/null differ diff --git a/ldm/models/diffusion/__pycache__/plms.cpython-38.pyc b/ldm/models/diffusion/__pycache__/plms.cpython-38.pyc deleted file mode 100644 index 66f4547..0000000 Binary files a/ldm/models/diffusion/__pycache__/plms.cpython-38.pyc and /dev/null differ diff --git a/ldm/modules/__pycache__/attention.cpython-36.pyc b/ldm/modules/__pycache__/attention.cpython-36.pyc deleted file mode 100644 index ba18a7e..0000000 Binary files a/ldm/modules/__pycache__/attention.cpython-36.pyc and /dev/null differ diff --git a/ldm/modules/__pycache__/attention.cpython-38.pyc b/ldm/modules/__pycache__/attention.cpython-38.pyc deleted file mode 100644 index dddaa85..0000000 Binary files a/ldm/modules/__pycache__/attention.cpython-38.pyc and /dev/null differ diff --git a/ldm/modules/__pycache__/ema.cpython-36.pyc b/ldm/modules/__pycache__/ema.cpython-36.pyc deleted file mode 100644 index e6a17e2..0000000 Binary files a/ldm/modules/__pycache__/ema.cpython-36.pyc and /dev/null differ diff --git a/ldm/modules/__pycache__/ema.cpython-38.pyc b/ldm/modules/__pycache__/ema.cpython-38.pyc deleted file mode 100644 index ad63cba..0000000 Binary files a/ldm/modules/__pycache__/ema.cpython-38.pyc and /dev/null differ diff --git a/ldm/modules/__pycache__/embedding_manager.cpython-36.pyc b/ldm/modules/__pycache__/embedding_manager.cpython-36.pyc deleted file mode 100644 index 14a1688..0000000 Binary files a/ldm/modules/__pycache__/embedding_manager.cpython-36.pyc and /dev/null differ diff --git a/ldm/modules/__pycache__/embedding_manager.cpython-38.pyc b/ldm/modules/__pycache__/embedding_manager.cpython-38.pyc deleted file mode 100644 index 3517a50..0000000 Binary files a/ldm/modules/__pycache__/embedding_manager.cpython-38.pyc and /dev/null differ diff --git a/ldm/modules/__pycache__/x_transformer.cpython-36.pyc b/ldm/modules/__pycache__/x_transformer.cpython-36.pyc deleted file mode 100644 index 48f9d94..0000000 Binary files a/ldm/modules/__pycache__/x_transformer.cpython-36.pyc and /dev/null differ diff --git a/ldm/modules/__pycache__/x_transformer.cpython-38.pyc b/ldm/modules/__pycache__/x_transformer.cpython-38.pyc deleted file mode 100644 index 799863b..0000000 Binary files a/ldm/modules/__pycache__/x_transformer.cpython-38.pyc and /dev/null differ diff --git a/ldm/modules/diffusionmodules/__pycache__/__init__.cpython-36.pyc b/ldm/modules/diffusionmodules/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 6aad904..0000000 Binary files a/ldm/modules/diffusionmodules/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/ldm/modules/diffusionmodules/__pycache__/__init__.cpython-38.pyc b/ldm/modules/diffusionmodules/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index d1e3122..0000000 Binary files a/ldm/modules/diffusionmodules/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/ldm/modules/diffusionmodules/__pycache__/model.cpython-36.pyc b/ldm/modules/diffusionmodules/__pycache__/model.cpython-36.pyc deleted file mode 100644 index 3e8b553..0000000 Binary files a/ldm/modules/diffusionmodules/__pycache__/model.cpython-36.pyc and /dev/null differ diff --git a/ldm/modules/diffusionmodules/__pycache__/model.cpython-38.pyc b/ldm/modules/diffusionmodules/__pycache__/model.cpython-38.pyc deleted file mode 100644 index ad09f37..0000000 Binary files a/ldm/modules/diffusionmodules/__pycache__/model.cpython-38.pyc and /dev/null differ diff --git a/ldm/modules/diffusionmodules/__pycache__/openaimodel.cpython-36.pyc b/ldm/modules/diffusionmodules/__pycache__/openaimodel.cpython-36.pyc deleted file mode 100644 index b399666..0000000 Binary files a/ldm/modules/diffusionmodules/__pycache__/openaimodel.cpython-36.pyc and /dev/null differ diff --git a/ldm/modules/diffusionmodules/__pycache__/openaimodel.cpython-38.pyc b/ldm/modules/diffusionmodules/__pycache__/openaimodel.cpython-38.pyc deleted file mode 100644 index 4e18bc6..0000000 Binary files a/ldm/modules/diffusionmodules/__pycache__/openaimodel.cpython-38.pyc and /dev/null differ diff --git a/ldm/modules/diffusionmodules/__pycache__/util.cpython-36.pyc b/ldm/modules/diffusionmodules/__pycache__/util.cpython-36.pyc deleted file mode 100644 index 4c636b0..0000000 Binary files a/ldm/modules/diffusionmodules/__pycache__/util.cpython-36.pyc and /dev/null differ diff --git a/ldm/modules/diffusionmodules/__pycache__/util.cpython-38.pyc b/ldm/modules/diffusionmodules/__pycache__/util.cpython-38.pyc deleted file mode 100644 index 20254a9..0000000 Binary files a/ldm/modules/diffusionmodules/__pycache__/util.cpython-38.pyc and /dev/null differ diff --git a/ldm/modules/distributions/__pycache__/__init__.cpython-36.pyc b/ldm/modules/distributions/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index e6de211..0000000 Binary files a/ldm/modules/distributions/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/ldm/modules/distributions/__pycache__/__init__.cpython-38.pyc b/ldm/modules/distributions/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index 4679c91..0000000 Binary files a/ldm/modules/distributions/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/ldm/modules/distributions/__pycache__/distributions.cpython-36.pyc b/ldm/modules/distributions/__pycache__/distributions.cpython-36.pyc deleted file mode 100644 index b730ba0..0000000 Binary files a/ldm/modules/distributions/__pycache__/distributions.cpython-36.pyc and /dev/null differ diff --git a/ldm/modules/distributions/__pycache__/distributions.cpython-38.pyc b/ldm/modules/distributions/__pycache__/distributions.cpython-38.pyc deleted file mode 100644 index 3967ec4..0000000 Binary files a/ldm/modules/distributions/__pycache__/distributions.cpython-38.pyc and /dev/null differ diff --git a/ldm/modules/encoders/__pycache__/__init__.cpython-36.pyc b/ldm/modules/encoders/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 5535ae3..0000000 Binary files a/ldm/modules/encoders/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/ldm/modules/encoders/__pycache__/__init__.cpython-38.pyc b/ldm/modules/encoders/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index 3a7163a..0000000 Binary files a/ldm/modules/encoders/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/ldm/modules/encoders/__pycache__/modules.cpython-36.pyc b/ldm/modules/encoders/__pycache__/modules.cpython-36.pyc deleted file mode 100644 index 069706b..0000000 Binary files a/ldm/modules/encoders/__pycache__/modules.cpython-36.pyc and /dev/null differ diff --git a/ldm/modules/encoders/__pycache__/modules.cpython-38.pyc b/ldm/modules/encoders/__pycache__/modules.cpython-38.pyc deleted file mode 100644 index 18edf47..0000000 Binary files a/ldm/modules/encoders/__pycache__/modules.cpython-38.pyc and /dev/null differ diff --git a/ldm/util.py b/ldm/util.py index aa0963a..63423e1 100644 --- a/ldm/util.py +++ b/ldm/util.py @@ -22,7 +22,9 @@ def log_txt_as_img(wh, xc, size=10): for bi in range(b): txt = Image.new("RGB", wh, color="white") draw = ImageDraw.Draw(txt) - font = ImageFont.truetype('data/DejaVuSans.ttf', size=size) + # Changed to work on Windows + font = ImageFont.load_default() + #font = ImageFont.truetype('data/DejaVuSans.ttf', size=size) nc = int(40 * (wh[0] / 256)) lines = "\n".join(xc[bi][start:start + nc] for start in range(0, len(xc[bi]), nc)) diff --git a/main.py b/main.py index 14834e8..b5ffa90 100644 --- a/main.py +++ b/main.py @@ -607,8 +607,6 @@ if __name__ == "__main__": lightning_config = config.pop("lightning", OmegaConf.create()) # merge trainer cli with config trainer_config = lightning_config.get("trainer", OmegaConf.create()) - # default to ddp - trainer_config["accelerator"] = "ddp" for k in nondefault_trainer_args(opt): trainer_config[k] = getattr(opt, k) if not "gpus" in trainer_config: @@ -821,8 +819,12 @@ if __name__ == "__main__": import signal - signal.signal(signal.SIGUSR1, melk) - signal.signal(signal.SIGUSR2, divein) + + # Changed to work with windows + signal.signal(signal.SIGTERM, melk) + #signal.signal(signal.SIGUSR1, melk) + signal.signal(signal.SIGTERM, divein) + #signal.signal(signal.SIGUSR2, divein) # run if opt.train: