You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/03/29 18:54:09 UTC

[GitHub] piiswrong commented on a change in pull request #10234: [MXNET-135] mx.image.imread support s3

piiswrong commented on a change in pull request #10234: [MXNET-135] mx.image.imread support s3
URL: https://github.com/apache/incubator-mxnet/pull/10234#discussion_r178150688
 
 

 ##########
 File path: src/io/image_io.cc
 ##########
 @@ -217,17 +218,17 @@ void Imread(const nnvm::NodeAttrs& attrs,
             std::vector<NDArray>* outputs) {
 #if MXNET_USE_OPENCV
   const auto& param = nnvm::get<ImreadParam>(attrs.parsed);
-
-  std::ifstream file(param.filename, std::ios::binary | std::ios::ate);
-  // if file is not open we get bad alloc after tellg
-  CHECK(file.is_open()) << "Imread: '" << param.filename
-      << "' couldn't open file: " << strerror(errno);
-  size_t fsize = file.tellg();
-  file.seekg(0, std::ios::beg);
+  dmlc::io::URI path(param.filename.c_str());
+  dmlc::io::FileSystem *fs = dmlc::io::FileSystem::GetInstance(path);
 
 Review comment:
   is fs ever deleted?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services