Skip to content

Duplicate tqdm progress lines are printed for the same training step #63

@danieldale2026

Description

@danieldale2026

Problem

During MOVA training, tqdm can print two progress records for the same training step, especially when log_interval=1.

Root Cause

pbar.set_postfix(...) uses refresh=True by default, which immediately refreshes the tqdm display.

At the end of the training loop, pbar.update(1) refreshes tqdm again. As a result, each logged step can be printed twice.

Expected Behavior

Each training step should print only one tqdm progress line.

Actual Behavior

The same training step can be printed twice in the tqdm output.

Fix Proposal

Update the tqdm display only once per logging interval:

pbar.set_postfix({
    "loss": f"{avg_loss:.4f}",
    "v_loss": f"{avg_video_loss:.4f}",
    "a_loss": f"{avg_audio_loss:.4f}",
    "lr": f"{lr:.2e}",
}, refresh=False)
pbar.update(self.log_interval)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions