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

Indexing #343

Open
muradtuk opened this issue Jul 27, 2023 · 1 comment
Open

Indexing #343

muradtuk opened this issue Jul 27, 2023 · 1 comment

Comments

@muradtuk
Copy link

Dear authors,

I wanted to ask the following:
Is it possible to get the original indices of the instance in each batch during traversal over the data (through the data loader)? In other words, is it possible to have something along the lines of

for images, targets, indices in loader:

without changing the beton file? Or is it possible to retrieve such indices from the loader?

Thanks in advance,
M.T.

@andrewilyas
Copy link
Contributor

Hi @muradtuk ! This should be possible - I'm not sure off the top of my head what the cleanest way to do it is, but you can definitely create a Pipeline that applies a transform that simply replaces the data with the index (see https://docs.ffcv.io/ffcv_examples/transform_with_inds.html) - this might be kind of wasteful but probably wouldn't slow things down too much.

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