stu1130 commented on a change in pull request #12131: [MXNET-737][WIP] Add last 
batch handle for imageiter
URL: https://github.com/apache/incubator-mxnet/pull/12131#discussion_r209756855
 
 

 ##########
 File path: python/mxnet/image/image.py
 ##########
 @@ -1059,16 +1059,21 @@ class ImageIter(io.DataIter):
         Label name for provided symbols.
     dtype : str
         Label data type. Default: float32. Other options: int32, int64, float64
+    last_batch_hanle :  str, optional
+        How to handle the last batch. This parameter can be ‘pad’, ‘discard’ 
or ‘roll_over’.
+        'discard' is not support when reading from record file(.rec) 
withouting shuffle(=False)
 
 Review comment:
   The reason why discard is not supported is that when we read the rec file 
sequentially we don't know how many images in the file. Therefore, there is no 
way we can precalculate the number of images we need to discard. The only two 
solutions that I came up with is 
   * iterate the file during the initialization of data iterator 
   * allow users to input the number of the images
   The first solution would take lots of time if the file is large during the 
initialization. The second one is not user-friendly. So I decided to give up 
this option.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to