get rid of pycache stuff and make work with windows

This commit is contained in:
Christopher Gammage 2022-09-25 17:09:41 -07:00
parent c87b1298bb
commit 25e5c2520e
54 changed files with 13 additions and 6 deletions

3
.gitignore vendored
View File

@ -3,3 +3,6 @@
gen.bat
gen_ref.bat
train.bat
__pycache__
*/**/__pycache__
logs

View File

@ -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

Binary file not shown.

Binary file not shown.

View File

@ -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))

10
main.py
View File

@ -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: