Based on the error message it seems that your data does not contain tensors (or any object, which could be indexed), but instead objects of an Example class.
Could you check your Dataset for this class?