Skip to content

inaccurate eval loss computation #41898

@wwt17

Description

@wwt17

losses.append(accelerator.gather_for_metrics(loss.repeat(args.per_device_eval_batch_size)))
The last batch may be smaller, since drop_last default to False for DataLoader construction. Thus, computing the mean over the losses is inaccurate.
Same issue for the train loss:
"train_loss": total_loss.item() / len(train_dataloader),

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