Your Dataset looks fine, but the error would most likely be part of your model’s forward definition or your train code (at least that’s where I observed such errors before).
If you could post these parts of your code (or link a gist), we could have a look on them.