Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Add drop_last parameter to WsiBatchSamplerPredict #30

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

EricMarcus-ai
Copy link
Member

Minor bug fix for inference. The WsiBatchSamplerPredict has the same functionality as WsiBatchSampler, except it has a different signature to interface with the lightning predict loop.
It was missing the drop_last attribute, causing an error during inference due to https://github.com/Lightning-AI/lightning/blob/482da0a14092f50f75b85a06a5ce353b8b81719b/src/lightning/pytorch/utilities/data.py#L278 .

@jonasteuwen
Copy link
Contributor

Can you add a comment why this is needed?

@jonasteuwen
Copy link
Contributor

@EricMarcus-ai Can't we set self.drop_last = False? I cannot imagine a situation where True would be useful

@EricMarcus-ai
Copy link
Member Author

Added the comment, and fixed the self.drop_last to False.

Copy link
Contributor

@jonasteuwen jonasteuwen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jonasteuwen jonasteuwen merged commit cb92914 into main Dec 6, 2023
1 check passed
@jonasteuwen jonasteuwen deleted the wsi_batch_sampler_fix branch December 6, 2023 17:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants