Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

How to save and change custom data into a exist dataset? #19203

Answered by Neutron3529
Neutron3529 asked this question in Q&A
Discussion options

You must be logged in to vote

as @zhreshold mentioned above

Instead of modifying dataloader to return the indices, I would rather overwrite the RandomSampler to save the indices to a list and checkpointing them after each epoch, you can retrieve the indices in the next epoch then. DataLoader allows you to set the sampler to sampler=CustomRandomSampler rather than shuffle.

That is the solution with no modifying the mxnet API.
Only 3 steps is needed:

  1. write a CustomRandomSampler using a global variable index, update index and return after each iter.
  2. using sampler=CustomRandomSampler istead of the default setting.
  3. create a custom_weight array, to save the right weights.

I'll try imagenet dataset after bought a rtx3090.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@szha
Comment options

szha Sep 22, 2020
Collaborator

@zhreshold
Comment options

@Neutron3529
Comment options

@zhreshold
Comment options

@Neutron3529
Comment options

Comment options

You must be logged in to vote
1 reply
@zhreshold
Comment options

Answer selected by Neutron3529
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants