Skip to content

Open-Sora: Democratizing Efficient Video Production for All

Python

[fix] start_from_scratch

zhengzangwfd51586704be
diff --git a/configs/opensora-v1-2/train/stage1.py b/configs/opensora-v1-2/train/stage1.py
index eb36c80..edef68a 100644
--- a/configs/opensora-v1-2/train/stage1.py
+++ b/configs/opensora-v1-2/train/stage1.py
@@ -82,16 +82,16 @@ scheduler = dict(
# Mask settings
mask_ratios = {
- "random": 0.2,
- "intepolate": 0.01,
- "quarter_random": 0.01,
- "quarter_head": 0.01,
- "quarter_tail": 0.01,
- "quarter_head_tail": 0.01,
- "image_random": 0.05,
- "image_head": 0.1,
- "image_tail": 0.05,
- "image_head_tail": 0.05,
+ "random": 0.05,
+ "intepolate": 0.005,
+ "quarter_random": 0.005,
+ "quarter_head": 0.005,
+ "quarter_tail": 0.005,
+ "quarter_head_tail": 0.005,
+ "image_random": 0.025,
+ "image_head": 0.05,
+ "image_tail": 0.025,
+ "image_head_tail": 0.025,
}
# Log settings
@@ -105,6 +105,6 @@ ckpt_every = 200
# optimization settings
load = None
grad_clip = 1.0
-lr = 2e-4
+lr = 1e-4
ema_decay = 0.99
adam_eps = 1e-15
diff --git a/scripts/train.py b/scripts/train.py
index 454e789..08681dc 100644
--- a/scripts/train.py
+++ b/scripts/train.py
@@ -209,9 +209,9 @@ def main():
ema=ema,
optimizer=optimizer,
lr_scheduler=lr_scheduler,
- sampler=None if cfg.get("start_from_scratch ", False) else sampler,
+ sampler=None if cfg.get("start_from_scratch", False) else sampler,
)
- if not cfg.get("start_from_scratch ", False):
+ if not cfg.get("start_from_scratch", False):
start_epoch, start_step = ret
logger.info("Loaded checkpoint %s at epoch %s step %s", cfg.load, start_epoch, start_step)