lichen11 opened a new issue #13139: Normalize pixels to [0,1] using im2rec or 
reassign values to rec files
URL: https://github.com/apache/incubator-mxnet/issues/13139
 
 
   I want to normalize the pixel values into [0, 255] without reading the 
images, normalizing them and re-saving them as jpeg. I used the im2rec API in R 
and notice there is no value normalization in this API. Then I tried reassign 
values to the rec files as follows:
   
   
       val = mx.io.ImageRecordIter(
               path.imgrec = val_data,
               batch.size  = batch_size,
               data.shape  = data_shape,
               rand.crop   = FALSE,
               rand.mirror = FALSE)
       val$reset()
       val$iter.next()
       val_data = val$value()$data
       val_data = as.array(val_data)
       val_data = val_data/255
       val$value()$data = val_data
   
   I got the error below
       Error in val$value()$data = val_data : 
         invalid (NULL) left side of assignment
   
   Is there another way to normalize the images by 255 in mxnet R? Thank you!

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