As the error message describes, your dataset returns objects, which isn’t supported as tensors, numpy arrays, numbers, dicts or lists are expected.
Check the type of the returned values in __getitem__ and make sure they are one of the supported types.