Skip to content

Commit

Permalink
fix: issue #13
Browse files Browse the repository at this point in the history
  • Loading branch information
YingqingHe committed Dec 22, 2024
1 parent f342676 commit b913f64
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion shscripts/train_cogvideox_lora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ python scripts/train.py \
--logdir $RESROOT \
--devices '0,' \
lightning.trainer.num_nodes=1 \
--auto_resume False
--auto_resume
2 changes: 1 addition & 1 deletion shscripts/train_dynamicrafter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ python scripts/train.py \
--ckpt $DCCKPT \
--devices '0,' \
lightning.trainer.num_nodes=1 \
--auto_resume True
--auto_resume

2 changes: 1 addition & 1 deletion shscripts/train_opensorav10.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ lightning.trainer.num_nodes=1 \
--base $CONFIG \
--name "$current_time"_$EXPNAME \
--logdir $LOGDIR \
--auto_resume True
--auto_resume
2 changes: 1 addition & 1 deletion shscripts/train_videocrafter_v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ python scripts/train.py \
--name ${CURRENT_TIME}_${EXPNAME} \
--devices '0,' \
lightning.trainer.num_nodes=1 \
--auto_resume True
--auto_resume
1 change: 0 additions & 1 deletion src/base/ddpm3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,6 @@ def differentiable_decode_first_stage(self, z, **kwargs):
"""same as decode_first_stage but without decorator"""
return self._decode_core(z, **kwargs)

@torch.no_grad()
def get_batch_input(self, batch, random_uncond, return_first_stage_outputs=False, return_original_cond=False, is_imgbatch=False):
## image/video shape: b, c, t, h, w
data_key = 'jpg' if is_imgbatch else self.first_stage_key
Expand Down
7 changes: 7 additions & 0 deletions src/utils/train_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,19 @@ def get_autoresume_path(logdir):
def set_logger(logfile, name='mainlogger'):
logger = logging.getLogger(name)
logger.setLevel(logging.INFO)

# Set the logger to prevent log propagation to the parent logger and print twice.
logger.propagate = False

fh = logging.FileHandler(logfile, mode='w')
fh.setLevel(logging.INFO)

ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)

fh.setFormatter(logging.Formatter("%(asctime)s-%(levelname)s: %(message)s"))
ch.setFormatter(logging.Formatter("%(message)s"))

logger.addHandler(fh)
logger.addHandler(ch)
return logger

0 comments on commit b913f64

Please sign in to comment.