Skip to content

validation_step description differs from implementation #329

@botcs

Description

@botcs

Hi,

this is just a tiny issue that I came across while adding a custom dataset, that's not in ImageFolder format.
In solo/methods/base.py L553 the validation_step says the following:

    """Validation step for pytorch lightning. It does all the shared operations, such as
    forwarding a batch of images, computing logits and computing metrics.

    Args:
        batch (List[torch.Tensor]):a batch of data in the format of [img_indexes, X, Y].
        batch_idx (int): index of the batch.

    Returns:
        Dict[str, Any]: dict with the batch_size (used for averaging), the classification loss
            and accuracies.
    """

However the batch is only split to X, Y according to L568:
X, targets = batch

As I said, it's a tiny thing, but not sure why or where does the library modify the dataset/dataloader to have a different return value depending on train/val split.
Sorry for the rookie question.

Thanks,
Csabi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions