Browse Source

!9133 Disable recursive walk of imagefolder

From: @ziruiwu
Reviewed-by: @mikef,@nsyca
Signed-off-by: @nsyca
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
97b1c5eed5
2 changed files with 3 additions and 2 deletions
  1. +1
    -1
      mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/include/datasets_bindings.cc
  2. +2
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/source/image_folder_op.cc

+ 1
- 1
mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/include/datasets_bindings.cc View File

@@ -193,7 +193,7 @@ PYBIND_REGISTER(ImageFolderNode, 2, ([](const py::module *m) {
.def(py::init([](std::string dataset_dir, bool decode, std::optional<py::handle> sampler, .def(py::init([](std::string dataset_dir, bool decode, std::optional<py::handle> sampler,
std::optional<py::list> extensions, std::optional<py::dict> class_indexing, std::optional<py::list> extensions, std::optional<py::dict> class_indexing,
std::optional<std::shared_ptr<CacheClient>> cc) { std::optional<std::shared_ptr<CacheClient>> cc) {
bool recursive = true;
bool recursive = false;
auto imagefolder = std::make_shared<ImageFolderNode>( auto imagefolder = std::make_shared<ImageFolderNode>(
dataset_dir, decode, toSamplerObj(sampler), recursive, toStringSet(extensions), dataset_dir, decode, toSamplerObj(sampler), recursive, toStringSet(extensions),
toStringMap(class_indexing), toDatasetCache(std::move(cc))); toStringMap(class_indexing), toDatasetCache(std::move(cc)));


+ 2
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/source/image_folder_op.cc View File

@@ -347,7 +347,8 @@ Status ImageFolderOp::RecursiveWalkFolder(Path *dir) {
RETURN_IF_NOT_OK(folder_name_queue_->EmplaceBack(subdir.toString().substr(dirname_offset_))); RETURN_IF_NOT_OK(folder_name_queue_->EmplaceBack(subdir.toString().substr(dirname_offset_)));
} }
if (recursive_ == true) { if (recursive_ == true) {
RETURN_IF_NOT_OK(RecursiveWalkFolder(&subdir));
MS_LOG(ERROR) << "RecursiveWalkFolder(&subdir) functionality is disabled permanently. No recursive walk of "
<< "directory will be performed.";
} }
} }
} }


Loading…
Cancel
Save