tobechao commented on issue #7664: index out of bound error when update eval 
metric
URL: 
https://github.com/apache/incubator-mxnet/issues/7664#issuecomment-355924384
 
 
   I add a while loop in image.py:
   def next(self):
       ...
       try:
               while i < batch_size:
                   label, s = self.next_sample()
                   data = self.imdecode(s)
                   try:
                       self.check_valid_image(data)
                   except RuntimeError as e:
                       logging.debug('Invalid image, skipping:  %s', str(e))
                       continue
                   data = self.augmentation_transform(data)
                   assert i < batch_size, 'Batch size must be multiples of 
augmenter output length'
                   batch_data[i] = self.postprocess_data(data)
                   batch_label[i] = label
                   i += 1
           except StopIteration:
               if not i:
                   raise StopIteration
       while i < batch_size:
           import copy
           batch_data[i] = copy.deepcopy(batch_data[0])
           batch_label[i] = copy.deepcopy(batch_label[0])
           i += 1
       ...
   
   I copy the first batch_szie-i times, It can works.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to