Sorry for not being clear enough. 
Print the idx in the training loop and note which idx is causing the error.
Then use this particular value to check, if dataset.samples[idx] exists or what should be at this position in the list.