Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validation_step description differs from implementation #329

Open
botcs opened this issue Mar 10, 2023 · 1 comment
Open

validation_step description differs from implementation #329

botcs opened this issue Mar 10, 2023 · 1 comment

Comments

@botcs
Copy link

botcs commented Mar 10, 2023

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

@vturrisi
Copy link
Owner

Hey! I think we just messed up the docstring and forgot to update it a long time ago. I would say that for sure we have other inconsistencies in the documentation that we plan on progressively updating. I'll try to open a small PR to fix this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants