From 25bb3960d40687afcf7cc5e1993e8d77a713db1d Mon Sep 17 00:00:00 2001 From: xiefangqi Date: Thu, 21 May 2020 10:48:18 +0800 Subject: [PATCH] add detail batch error to log --- mindspore/ccsrc/dataset/engine/datasetops/batch_op.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mindspore/ccsrc/dataset/engine/datasetops/batch_op.cc b/mindspore/ccsrc/dataset/engine/datasetops/batch_op.cc index bfe9079501a..374128eb217 100644 --- a/mindspore/ccsrc/dataset/engine/datasetops/batch_op.cc +++ b/mindspore/ccsrc/dataset/engine/datasetops/batch_op.cc @@ -164,7 +164,14 @@ Status BatchOp::BatchRows(const std::unique_ptr *source_table, if (row[i]->shape() == row_shapes[i]) { // check the newly popped rows have the same dim as the first RETURN_IF_NOT_OK(batched_row[i]->InsertTensor(std::vector(1, j), row[i])); } else { - RETURN_STATUS_UNEXPECTED("[Batch ERROR] Inconsistent TensorShapes\n"); + std::string column_name; + for (auto itr : column_name_id_map_) { + if (static_cast(itr.second) == i) { + column_name = itr.first; + break; + } + } + RETURN_STATUS_UNEXPECTED("[Batch ERROR] Inconsistent TensorShapes of Column " + column_name); } } }