diff --git a/mindspore/ccsrc/minddata/dataset/core/data_type.cc b/mindspore/ccsrc/minddata/dataset/core/data_type.cc index 80041253f0..0e03a7d327 100644 --- a/mindspore/ccsrc/minddata/dataset/core/data_type.cc +++ b/mindspore/ccsrc/minddata/dataset/core/data_type.cc @@ -51,7 +51,11 @@ uint8_t DataType::AsCVType() const { } if (res == kCVInvalidType) { - std::string err_msg = "Cannot convert [" + std::string(kTypeInfo[type_].name_) + "] to OpenCV type."; + std::string type_name = "unknown"; + if (type_ < DataType::NUM_OF_TYPES) { + type_name = std::string(kTypeInfo[type_].name_); + } + std::string err_msg = "Cannot convert [" + type_name + "] to OpenCV type."; err_msg += " Currently unsupported data type: [uint32, int64, uint64, string]"; MS_LOG(ERROR) << err_msg; } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/cpu_map_job.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/cpu_map_job.cc index 907fe52c1d..687f7869ae 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/cpu_map_job.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/cpu_map_job.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include "minddata/dataset/engine/datasetops/map_op/cpu_map_job.h" namespace mindspore { diff --git a/mindspore/ccsrc/minddata/dataset/util/rdr.h b/mindspore/ccsrc/minddata/dataset/util/rdr.h index cb4b7f9422..50369f8462 100644 --- a/mindspore/ccsrc/minddata/dataset/util/rdr.h +++ b/mindspore/ccsrc/minddata/dataset/util/rdr.h @@ -24,7 +24,7 @@ namespace mindspore { namespace dataset { class MDChannelInfo { public: - explicit MDChannelInfo(std::string channel_name) : channel_name_(channel_name) {} + explicit MDChannelInfo(std::string channel_name) : channel_name_(channel_name), preprocess_batch_(0) {} ~MDChannelInfo() = default; diff --git a/model_zoo/official/cv/faster_rcnn/src/dataset.py b/model_zoo/official/cv/faster_rcnn/src/dataset.py index d7abeb043b..6b2995e035 100644 --- a/model_zoo/official/cv/faster_rcnn/src/dataset.py +++ b/model_zoo/official/cv/faster_rcnn/src/dataset.py @@ -20,12 +20,12 @@ import os import numpy as np from numpy import random +import cv2 import mmcv import mindspore.dataset as de import mindspore.dataset.vision.c_transforms as C from mindspore.mindrecord import FileWriter from src.config import config -import cv2 def bbox_overlaps(bboxes1, bboxes2, mode='iou'):