!24044 modify error info

Merge pull request !24044 from shenwei41/master
This commit is contained in:
i-robot 2021-09-27 01:12:01 +00:00 committed by Gitee
commit 5728a48462
5 changed files with 12 additions and 4 deletions

View File

@ -424,6 +424,7 @@ class RandomCrop final : public TensorTransform {
/// - BorderType::kEdge, Fill the border with the last value on the edge.
/// - BorderType::kReflect, Reflect the values on the edge omitting the last value of edge.
/// - BorderType::kSymmetric, Reflect the values on the edge repeating the last value of edge.
/// \note If the input image is more than one, then make sure that the image size is the same.
explicit RandomCrop(std::vector<int32_t> size, std::vector<int32_t> padding = {0, 0, 0, 0},
bool pad_if_needed = false, std::vector<uint8_t> fill_value = {0, 0, 0},
BorderType padding_mode = BorderType::kConstant);
@ -687,6 +688,7 @@ class RandomResizedCrop final : public TensorTransform {
/// - InterpolationMode::kCubicPil, Interpolation method is bicubic interpolation like implemented in pillow.
/// \param[in] max_attempts The maximum number of attempts to propose a valid.
/// crop_area (default=10). If exceeded, fall back to use center_crop instead.
/// \note If the input image is more than one, then make sure that the image size is the same.
explicit RandomResizedCrop(std::vector<int32_t> size, std::vector<float> scale = {0.08, 1.0},
std::vector<float> ratio = {3. / 4., 4. / 3.},
InterpolationMode interpolation = InterpolationMode::kLinear, int32_t max_attempts = 10);

View File

@ -55,7 +55,7 @@ Status RandomCropAndResizeOp::Compute(const TensorRow &input, TensorRow *output)
RETURN_STATUS_UNEXPECTED(err_msg);
}
if (input[i]->shape()[0] != input[i + 1]->shape()[0] || input[i]->shape()[1] != input[i + 1]->shape()[1]) {
RETURN_STATUS_UNEXPECTED("RandomCropAndResizeOp: The width and height of the image need to be the same size.");
RETURN_STATUS_UNEXPECTED("RandomCropAndResizeOp: Input images must have the same size.");
}
}
}

View File

@ -128,7 +128,7 @@ Status RandomCropOp::Compute(const TensorRow &input, TensorRow *output) {
RETURN_STATUS_UNEXPECTED(err_msg);
}
if (input[i]->shape()[0] != input[i + 1]->shape()[0] || input[i]->shape()[1] != input[i + 1]->shape()[1]) {
RETURN_STATUS_UNEXPECTED("RandomCropOp: The width and height of the image need to be the same size.");
RETURN_STATUS_UNEXPECTED("RandomCropOp: Input images must have the same size.");
}
}
}

View File

@ -307,10 +307,10 @@ PYBIND11_MODULE(_c_expression, m) {
mindspore::pipeline::ClearResAtexit();
#ifdef ENABLE_MINDDATA
MS_LOG(WARNING) << "Start releasing dataset handles...";
MS_LOG(INFO) << "Start releasing dataset handles...";
py::module iterators = py::module::import("mindspore.dataset.engine.iterators");
(void)iterators.attr("_cleanup")();
MS_LOG(WARNING) << "End release dataset handles.";
MS_LOG(INFO) << "End release dataset handles.";
#endif
}
}});

View File

@ -894,6 +894,9 @@ class RandomCrop(ImageTensorOperation):
Crop the input image at a random location. If input image size is smaller than output size,
input image will be padded before cropping.
Note:
If the input image is more than one, then make sure that the image size is the same.
Args:
size (Union[int, sequence]): The output size of the cropped image.
If size is an integer, a square crop of size (size, size) is returned.
@ -1200,6 +1203,9 @@ class RandomResizedCrop(ImageTensorOperation):
Crop the input image to a random size and aspect ratio. This operator will crop the input image randomly, and
resize the cropped image using a selected interpolation mode.
Note:
If the input image is more than one, then make sure that the image size is the same.
Args:
size (Union[int, sequence]): The output size of the resized image.
If size is an integer, a square crop of size (size, size) is returned.