diff --git a/mindspore/ccsrc/dataset/engine/datasetops/source/voc_op.cc b/mindspore/ccsrc/dataset/engine/datasetops/source/voc_op.cc index 63deec26a9d54bc3b05d785d02f5a0403e7d1501..5896126bee237a225718b043d72df71d3867f497 100644 --- a/mindspore/ccsrc/dataset/engine/datasetops/source/voc_op.cc +++ b/mindspore/ccsrc/dataset/engine/datasetops/source/voc_op.cc @@ -270,7 +270,11 @@ Status VOCOp::ParseImageIds() { } std::string id; while (getline(in_file, id)) { - image_ids_.push_back(id); + if (id[id.size() - 1] == '\r') { + image_ids_.push_back(id.substr(0, id.size() - 1)); + } else { + image_ids_.push_back(id); + } } in_file.close(); image_ids_.shrink_to_fit();