I’m not sure if that’s the issue here, as it seems your Dataset was successfully split.
Could you try to get a single sample after the splitting using:
train_dataset[0]
test_dataset[0]

Also, were you successful in getting the idx before the crash occurs?