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/04/04 09:17:07 UTC

[GitHub] Allloginsbusy opened a new issue #10393: ImageRecordIOParser2 Assertion failed

Allloginsbusy opened a new issue #10393: ImageRecordIOParser2 Assertion failed
URL: https://github.com/apache/incubator-mxnet/issues/10393
 
 
   I use python3 and try to get images by .rec file.
   I use ImageRecordIter. After 3000000 images I have got, I see OpenCV Error: Assertion failed . 
   Also I tried only go by iterator and do nothing, but saw the same error on same image.
   
   Here is part of my code.
   
   data_iter = mx.io.ImageRecordIter(
       path_imgrec=data_path, # the target record file
       data_shape=(3, 112, 112), # output data shape. An 227x227 region will be cropped from the original image.
       batch_size=BATCH_SIZE # number of samples per batch
   
       )
   data_iter.reset()
   for batch in data_iter:
           for i in range(BATCH_SIZE):
               img = Image.fromarray(batch.data[0][i].asnumpy().astype(np.uint8).transpose((1, 2, 0)))
               img.save(path)
               
           
   
   Full Error message.
   [18:27:27] src/io/iter_image_recordio_2.cc:170: ImageRecordIOParser2: Data/faces_vgg_112x112/train.rec, use 1 threads for decoding..
   OpenCV Error: Assertion failed (!buf.empty() && buf.isContinuous()) in imdecode_, file /home/travis/build/dmlc/mxnet-distro/deps/opencv-3.3.0/modules/imgcodecs/src/loadsave.cpp, line 637
   terminate called after throwing an instance of 'cv::Exception'
     what():  /home/travis/build/dmlc/mxnet-distro/deps/opencv-3.3.0/modules/imgcodecs/src/loadsave.cpp:637: error: (-215) !buf.empty() && buf.isContinuous() in function imdecode_
   
   

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