diff --git a/tensorflow/python/data/experimental/ops/interleave_ops.py b/tensorflow/python/data/experimental/ops/interleave_ops.py index 4c16d353107..f2729429532 100644 --- a/tensorflow/python/data/experimental/ops/interleave_ops.py +++ b/tensorflow/python/data/experimental/ops/interleave_ops.py @@ -111,11 +111,17 @@ class _DirectedInterleaveDataset(dataset_ops.DatasetV2): first_output_types = dataset_ops.get_legacy_output_types(data_inputs[0]) first_output_classes = dataset_ops.get_legacy_output_classes(data_inputs[0]) - for data_input in data_inputs[1:]: + for i, data_input in enumerate(data_inputs[1:]): if (dataset_ops.get_legacy_output_types(data_input) != first_output_types or dataset_ops.get_legacy_output_classes(data_input) != first_output_classes): - raise TypeError("All datasets must have the same type and class.") + raise TypeError("All datasets must have the same type and class.\n" + "dataset 0 vs dataset %s types: %s ; %s\n" + "classes: %s ; %s" % + (i + 1, first_output_types, + dataset_ops.get_legacy_output_types(data_input), + first_output_classes, + dataset_ops.get_legacy_output_classes(data_input))) output_shapes = dataset_ops.get_legacy_output_shapes(self._data_inputs[0]) for data_input in self._data_inputs[1:]: