You get that error because the dataloader has to return something. Here are three solutions:
- There is a libary called nonechucks which lets you create dataloaders in which you can skip samples.
- Usually you could preprocess/clean your data and kick the unwanted samples out.
- You could return some indicator that the sample is unwanted, for example
if "y": return data, target else: return -1
And then you could check in your train loop if the “data” is -1 and skip the iteration. I hope this was helpful 🙂
CLICK HERE to find out more related problems solutions.