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/07/24 10:16:17 UTC

[GitHub] knwng opened a new issue #11870: error when add RandomCropAug into aug_list during initialization of ImageIter

knwng opened a new issue #11870: error when add RandomCropAug into aug_list during initialization of ImageIter
URL: https://github.com/apache/incubator-mxnet/issues/11870
 
 
   Hi, I think there's a bug when you want to apply random cropping in ImageIter in python as follows:
   
   > mx.image.ImageIter(batch_size=32, data_shape=(3, 244, 244), aug_list=[mx.image.RandomCropAug(128, 128)], ...)
   
   since the shape of each batch is set in advance(image/image.py, line 1186-1187):
   > batch_data = nd.empty((batch_size, c, h, w))
   > batch_label = nd.empty(self.provide_label[0][1])
   
   in image/image.py, line 1201, the processed image is directly assigned back to batch_data:
   > batch_data[i] = self.postprocess_data(data)
   
   Since the shapes of batch_data and the cropped image are different if you apply random cropping, the cropped image cannot be broadcasted and will raise an error:
   > ValueError: operands could not be broadcast together with remapped shapes[original->remapped]: (3, 128, 128) and requested shape (3, 244, 244)
   
   I think we can check if RandomCropAug or RandomSizedCropAug are in aug_list first, if so, the shape of batch_data should be set to the size of cropped image and I'm working on it.

----------------------------------------------------------------
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