Browse Source

!9783 Address PR9677 comments

From: @luoyang42
Reviewed-by: @liucunwei,@heleiwang
Signed-off-by: @liucunwei
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
49172089f1
4 changed files with 5 additions and 5 deletions
  1. +1
    -1
      mindspore/ccsrc/minddata/dataset/api/minddata_eager.cc
  2. +1
    -1
      mindspore/ccsrc/minddata/dataset/include/minddata_eager.h
  3. +2
    -2
      tests/cxx_st/dataset/test_de.cc
  4. +1
    -1
      tests/cxx_st/runtest.sh

+ 1
- 1
mindspore/ccsrc/minddata/dataset/api/minddata_eager.cc View File

@@ -68,7 +68,7 @@ Status MindDataEager::LoadImageFromDir(const std::string &image_dir, std::vector
// Check target directory
dataset::Path image_dir_(image_dir);
if (!image_dir_.Exists() || !image_dir_.IsDirectory()) {
std::string err_msg = "Target directory: " + image_dir + " does not exist or not a dir.";
std::string err_msg = "Target directory: " + image_dir + " does not exist or not a directory.";
MS_LOG(ERROR) << err_msg;
return Status(StatusCode::FAILED, err_msg);
}


+ 1
- 1
mindspore/ccsrc/minddata/dataset/include/minddata_eager.h View File

@@ -45,7 +45,7 @@ class MindDataEager {
/// \brief Function to read images from local directory
/// \param[inout] image_dir Target directory which contains images
/// \param[output] images Vector of image Tensor
/// \return Return error status if encounters exception
/// \return Status The status code returned
static Status LoadImageFromDir(const std::string &image_dir, std::vector<std::shared_ptr<Tensor>> *images);

/// \brief Callable function to execute the TensorOperation in eager mode


+ 2
- 2
tests/cxx_st/dataset/test_de.cc View File

@@ -29,9 +29,9 @@ class TestDE : public ST::Common {
TestDE() {}
};

TEST_F(TestDE, Test1) {
TEST_F(TestDE, ResNetPreprocess) {
std::vector<std::shared_ptr<Tensor>> images;
MindDataEager::LoadImageFromDir("/home/eager/apple", &images);
MindDataEager::LoadImageFromDir("/home/workspace/mindspore_dataset/imagenet/imagenet_original/val/n01440764", &images);

MindDataEager Compose({Decode(),
Resize({224, 224}),


+ 1
- 1
tests/cxx_st/runtest.sh View File

@@ -24,7 +24,7 @@ else
echo "BUILD_PATH = $BUILD_PATH"
fi

cd ${BUILD_PATH}/mindspore/tests/cxx_st2
cd ${BUILD_PATH}/mindspore/tests/cxx_st

export LD_LIBRARY_PATH=${BUILD_PATH}/mindspore/googletest/googlemock/gtest:${PROJECT_PATH}/mindspore:${PROJECT_PATH}/mindspore/lib:$LD_LIBRARY_PATH
export PYTHONPATH=${PROJECT_PATH}/tests/ut/cpp/python_input:$PYTHONPATH:${PROJECT_PATH}


Loading…
Cancel
Save