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

Dataset Indexing Issue #37

Open
ming024 opened this issue May 18, 2023 · 0 comments
Open

Dataset Indexing Issue #37

ming024 opened this issue May 18, 2023 · 0 comments

Comments

@ming024
Copy link

ming024 commented May 18, 2023

In the data collator of AddLabelDataset

def collater(self, samples):
collated = self.dataset.collater(samples)
if len(collated) == 0:
return collated
indices = set(collated["id"].tolist())
target = torch.LongTensor([s["label"] for s in samples if s["id"] in indices])

If self.dataset.collater sort the collated data, target and collated will become mismatched.

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

1 participant