I guess this error might be raised by a scipy transformation, if an empty numpy array is passed to it.
You could add print statements to the Dataset.__getitem__ method and check, which index (and transformation) raises this error to narrow down, if the previous transformations might have created an empty array.