I would like to start my data loader at a specific batch_idx.
I want to be able to continue my training from the exact batch_idx where it stopped or crashed.
I don’t use shuffling so it should be possible.
The only solution I came up with is the naive running though the for loop until I get to where I want:
start_batch_idx, ... = load_saved_training() for batch_idx, (data, target) in enumerate(train_loader): if batch_idx < start_batch_idx: continue # train if batch_idx % 100: # save training (including batch_idx)