diff --git a/cmake/package.cmake b/cmake/package.cmake index 2981294bbf3..abcc079746f 100644 --- a/cmake/package.cmake +++ b/cmake/package.cmake @@ -52,7 +52,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows") set(jpeg_turbo_LIBPATH ${jpeg_turbo_LIBPATH}/../bin/) set(sqlite_LIBPATH ${sqlite_LIBPATH}/../bin/) set(tinyxml2_LIBPATH ${tinyxml2_LIBPATH}/../bin/) - set(sentencepiece_LIBPATH ${sentencepiece_LIBPATH}/../bin/) else() set(INSTALL_LIB_DIR "lib") endif() @@ -136,14 +135,6 @@ if(ENABLE_MINDDATA) DESTINATION ${INSTALL_LIB_DIR} COMPONENT mindspore ) - file(GLOB_RECURSE SENTENCEPIECE_LIB_LIST - ${sentencepiece_LIBPATH}/libsentencepiece* - ) - install( - FILES ${SENTENCEPIECE_LIB_LIST} - DESTINATION ${INSTALL_LIB_DIR} - COMPONENT mindspore - ) if(CMAKE_SYSTEM_NAME MATCHES "Windows") message("icu4c does not support windows system temporarily") else() diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.cc index 2e3beaba4d8..a74ed0120d2 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.cc @@ -351,7 +351,7 @@ Status BatchOp::InvokeBatchSizeFunc(int32_t *batch_size, CBatchInfo info) { "Invalid parameter, batch_size function should return an integer greater than 0."); } } - return Status(StatusCode::kSuccess, "batch_size function call succeedeed."); + return Status(StatusCode::kSuccess, "batch_size function call succeeded."); } Status BatchOp::InvokeBatchMapFunc(TensorTable *input, TensorTable *output, CBatchInfo info) { diff --git a/mindspore/ccsrc/minddata/dataset/kernels/image/crop_op.cc b/mindspore/ccsrc/minddata/dataset/kernels/image/crop_op.cc index 426052e1913..93886c4b68b 100644 --- a/mindspore/ccsrc/minddata/dataset/kernels/image/crop_op.cc +++ b/mindspore/ccsrc/minddata/dataset/kernels/image/crop_op.cc @@ -44,7 +44,9 @@ Status CropOp::OutputShape(const std::vector &inputs, std::vector image_shape = input.at(0)->shape().AsVector(); std::vector label_shape = input.at(1)->shape().AsVector(); diff --git a/mindspore/ccsrc/minddata/dataset/kernels/image/decode_op.cc b/mindspore/ccsrc/minddata/dataset/kernels/image/decode_op.cc index a5011e5e2f8..79630442246 100644 --- a/mindspore/ccsrc/minddata/dataset/kernels/image/decode_op.cc +++ b/mindspore/ccsrc/minddata/dataset/kernels/image/decode_op.cc @@ -52,7 +52,9 @@ Status DecodeOp::OutputShape(const std::vector &inputs, std::vector TensorShape out({-1, -1, 3}); // we don't know what is output image size, but we know it should be 3 channels if (inputs[0].Rank() == 1) outputs.emplace_back(out); if (!outputs.empty()) return Status::OK(); - return Status(StatusCode::kMDUnexpectedError, "Decode: invalid input shape."); + return Status( + StatusCode::kMDUnexpectedError, + "Decode: invalid input shape, expected 1D input, but got input dimension is:" + std::to_string(inputs[0].Rank())); } Status DecodeOp::OutputType(const std::vector &inputs, std::vector &outputs) { diff --git a/mindspore/ccsrc/minddata/dataset/kernels/image/hwc_to_chw_op.cc b/mindspore/ccsrc/minddata/dataset/kernels/image/hwc_to_chw_op.cc index 311b65020bd..45c79a4f91a 100644 --- a/mindspore/ccsrc/minddata/dataset/kernels/image/hwc_to_chw_op.cc +++ b/mindspore/ccsrc/minddata/dataset/kernels/image/hwc_to_chw_op.cc @@ -33,7 +33,9 @@ Status HwcToChwOp::OutputShape(const std::vector &inputs, std::vect TensorShape out = TensorShape{in[2], in[0], in[1]}; if (inputs[0].Rank() == 3) outputs.emplace_back(out); if (!outputs.empty()) return Status::OK(); - return Status(StatusCode::kMDUnexpectedError, "HWC2CHW: invalid input shape."); + return Status( + StatusCode::kMDUnexpectedError, + "HWC2CHW: invalid input shape, expected 3D input, but got input dimension is:" + std::to_string(inputs[0].Rank())); } } // namespace dataset } // namespace mindspore diff --git a/mindspore/ccsrc/minddata/dataset/kernels/image/image_utils.cc b/mindspore/ccsrc/minddata/dataset/kernels/image/image_utils.cc index 9cb63e80ecf..66ef8b0b065 100644 --- a/mindspore/ccsrc/minddata/dataset/kernels/image/image_utils.cc +++ b/mindspore/ccsrc/minddata/dataset/kernels/image/image_utils.cc @@ -403,11 +403,15 @@ Status Crop(const std::shared_ptr &input, std::shared_ptr *outpu } // account for integer overflow if (y < 0 || (y + h) > input_cv->shape()[0] || (y + h) < 0) { - RETURN_STATUS_UNEXPECTED("Crop: invalid y coordinate value for crop"); + RETURN_STATUS_UNEXPECTED( + "Crop: invalid y coordinate value for crop, " + "y coordinate value exceeds the boundary of the image."); } // account for integer overflow if (x < 0 || (x + w) > input_cv->shape()[1] || (x + w) < 0) { - RETURN_STATUS_UNEXPECTED("Crop: invalid x coordinate value for crop"); + RETURN_STATUS_UNEXPECTED( + "Crop: invalid x coordinate value for crop, " + "x coordinate value exceeds the boundary of the image."); } try { TensorShape shape{h, w}; @@ -751,7 +755,9 @@ Status Normalize(const std::shared_ptr &input, std::shared_ptr * Normalize(input, output, mean, std); break; default: - RETURN_STATUS_UNEXPECTED("Normalize: unsupported type."); + RETURN_STATUS_UNEXPECTED( + "Normalize: unsupported type, currently supported types include " + "[bool,int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,int64_t,uint64_t,float16,float,double]."); } if (input->Rank() == MIN_IMAGE_DIMENSION) { @@ -965,7 +971,7 @@ Status AdjustSaturation(const std::shared_ptr &input, std::shared_ptr &input, std::shared_ptr *output, const float &hue) { if (hue > 0.5 || hue < -0.5) { - RETURN_STATUS_UNEXPECTED("AdjustHue: hue value is not in [-0.5, 0.5]."); + RETURN_STATUS_UNEXPECTED("AdjustHue: invalid parameter, hue is not within [-0.5, 0.5]."); } try { std::shared_ptr input_cv = CVTensor::AsCVTensor(input); diff --git a/mindspore/ccsrc/minddata/dataset/kernels/image/invert_op.cc b/mindspore/ccsrc/minddata/dataset/kernels/image/invert_op.cc index 49e3ddd3afb..863b4d7a011 100644 --- a/mindspore/ccsrc/minddata/dataset/kernels/image/invert_op.cc +++ b/mindspore/ccsrc/minddata/dataset/kernels/image/invert_op.cc @@ -38,7 +38,10 @@ Status InvertOp::Compute(const std::shared_ptr &input, std::shared_ptrshape()[2]; if (num_channels != 3) { - RETURN_STATUS_UNEXPECTED("Invert: image shape is incorrect: num of channels != 3"); + RETURN_STATUS_UNEXPECTED( + "Invert: image shape is incorrect, expected num of channels is 3, " + "but got:" + + std::to_string(num_channels)); } std::shared_ptr output_cv; RETURN_IF_NOT_OK(CVTensor::CreateEmpty(input_cv->shape(), input_cv->type(), &output_cv)); diff --git a/mindspore/ccsrc/minddata/dataset/kernels/image/lite_image_utils.cc b/mindspore/ccsrc/minddata/dataset/kernels/image/lite_image_utils.cc index 8798cf0420b..24a0a57ef25 100644 --- a/mindspore/ccsrc/minddata/dataset/kernels/image/lite_image_utils.cc +++ b/mindspore/ccsrc/minddata/dataset/kernels/image/lite_image_utils.cc @@ -244,11 +244,15 @@ Status Crop(const std::shared_ptr &input, std::shared_ptr *outpu // account for integer overflow if (y < 0 || (y + h) > input->shape()[0] || (y + h) < 0) { - RETURN_STATUS_UNEXPECTED("Crop: invalid y coordinate value for crop"); + RETURN_STATUS_UNEXPECTED( + "Crop: invalid y coordinate value for crop" + "y coordinate value exceeds the boundary of the image."); } // account for integer overflow if (x < 0 || (x + w) > input->shape()[1] || (x + w) < 0) { - RETURN_STATUS_UNEXPECTED("Crop: invalid x coordinate value for crop"); + RETURN_STATUS_UNEXPECTED( + "Crop: invalid x coordinate value for crop" + "x coordinate value exceeds the boundary of the image."); } try { diff --git a/mindspore/ccsrc/minddata/dataset/kernels/image/pad_op.cc b/mindspore/ccsrc/minddata/dataset/kernels/image/pad_op.cc index 70c108ec335..bdd497738f6 100644 --- a/mindspore/ccsrc/minddata/dataset/kernels/image/pad_op.cc +++ b/mindspore/ccsrc/minddata/dataset/kernels/image/pad_op.cc @@ -48,7 +48,9 @@ Status PadOp::OutputShape(const std::vector &inputs, std::vector &inputs Status RandomCropAndResizeOp::GetCropBox(int h_in, int w_in, int *x, int *y, int *crop_height, int *crop_width) { *crop_width = w_in; *crop_height = h_in; - CHECK_FAIL_RETURN_UNEXPECTED(w_in != 0, "RandomCropAndResize: Width is 0"); - CHECK_FAIL_RETURN_UNEXPECTED(h_in != 0, "RandomCropAndResize: Height is 0"); - CHECK_FAIL_RETURN_UNEXPECTED(aspect_lb_ > 0, "RandomCropAndResize: aspect lower bound must be greater than zero"); + CHECK_FAIL_RETURN_UNEXPECTED(w_in != 0, "RandomCropAndResize: Width cannot be 0."); + CHECK_FAIL_RETURN_UNEXPECTED(h_in != 0, "RandomCropAndResize: Height cannot be 0."); + CHECK_FAIL_RETURN_UNEXPECTED(aspect_lb_ > 0, "RandomCropAndResize: aspect lower bound must be greater than zero."); for (int32_t i = 0; i < max_iter_; i++) { double const sample_scale = rnd_scale_(rnd_); // In case of non-symmetrical aspect ratios, use uniform distribution on a logarithmic sample_scale. diff --git a/mindspore/ccsrc/minddata/dataset/kernels/image/random_crop_op.cc b/mindspore/ccsrc/minddata/dataset/kernels/image/random_crop_op.cc index c8e4105c3b8..e69fc2ab8b7 100644 --- a/mindspore/ccsrc/minddata/dataset/kernels/image/random_crop_op.cc +++ b/mindspore/ccsrc/minddata/dataset/kernels/image/random_crop_op.cc @@ -146,7 +146,9 @@ Status RandomCropOp::OutputShape(const std::vector &inputs, std::ve if (inputs[0].Rank() == 2) outputs.emplace_back(out); if (inputs[0].Rank() == 3) outputs.emplace_back(out.AppendDim(inputs[0][2])); if (!outputs.empty()) return Status::OK(); - return Status(StatusCode::kMDUnexpectedError, "RandomCrop: invalid input shape."); + return Status(StatusCode::kMDUnexpectedError, + "RandomCrop: invalid input shape, expected 2D or 3D input, but got input dimension is:" + + std::to_string(inputs[0].Rank())); } } // namespace dataset } // namespace mindspore diff --git a/mindspore/ccsrc/minddata/dataset/kernels/image/random_rotation_op.cc b/mindspore/ccsrc/minddata/dataset/kernels/image/random_rotation_op.cc index fd82d5f754a..079523ba0e1 100644 --- a/mindspore/ccsrc/minddata/dataset/kernels/image/random_rotation_op.cc +++ b/mindspore/ccsrc/minddata/dataset/kernels/image/random_rotation_op.cc @@ -76,7 +76,9 @@ Status RandomRotationOp::OutputShape(const std::vector &inputs, std if (inputs[0].Rank() == 2) outputs.emplace_back(out); if (inputs[0].Rank() == 3) outputs.emplace_back(out.AppendDim(inputs[0][2])); if (!outputs.empty()) return Status::OK(); - return Status(StatusCode::kMDUnexpectedError, "RandomRotation: invalid input shape."); + return Status(StatusCode::kMDUnexpectedError, + "RandomRotation: invalid input shape, expected 2D or 3D input, but got input dimension is:" + + std::to_string(inputs[0].Rank())); } } // namespace dataset } // namespace mindspore diff --git a/mindspore/ccsrc/minddata/dataset/kernels/image/resize_op.cc b/mindspore/ccsrc/minddata/dataset/kernels/image/resize_op.cc index 6d9ec7a1279..62614b89c10 100644 --- a/mindspore/ccsrc/minddata/dataset/kernels/image/resize_op.cc +++ b/mindspore/ccsrc/minddata/dataset/kernels/image/resize_op.cc @@ -35,11 +35,11 @@ Status ResizeOp::Compute(const std::shared_ptr &input, std::shared_ptr(input->shape()[1]); if (size2_ == 0) { if (input_h < input_w) { - CHECK_FAIL_RETURN_UNEXPECTED(input_h != 0, "Resize: the input height is 0."); + CHECK_FAIL_RETURN_UNEXPECTED(input_h != 0, "Resize: the input height cannot be 0."); output_h = size1_; output_w = static_cast(std::lround(static_cast(input_w) / input_h * output_h)); } else { - CHECK_FAIL_RETURN_UNEXPECTED(input_w != 0, "Resize: the input width is 0."); + CHECK_FAIL_RETURN_UNEXPECTED(input_w != 0, "Resize: the input width cannot be 0."); output_w = size1_; output_h = static_cast(std::lround(static_cast(input_h) / input_w * output_w)); }