Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

ImageRecordIOParser2 Assertion failed #10393

Closed
Gerkam opened this issue Apr 4, 2018 · 3 comments · Fixed by dmlc/dmlc-core#517
Closed

ImageRecordIOParser2 Assertion failed #10393

Gerkam opened this issue Apr 4, 2018 · 3 comments · Fixed by dmlc/dmlc-core#517
Labels
Bug Data-loading pr-awaiting-response PR is reviewed and waiting for contributor to respond

Comments

@Gerkam
Copy link

Gerkam commented Apr 4, 2018

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_

@foamliu
Copy link

foamliu commented Feb 15, 2019

same issue. Gerkam, have you solved this?

@anirudhacharya
Copy link
Member

can you share the .rec file that is throwing this error? It would be ideal if you could share a minimal .rec file that can reproduce the error rather than the whole dataset that you may be using.

@piyushghai
Copy link
Contributor

@mxnet-label-bot Update [Bug, Data-loading, pr-awaiting-response]

@foamliu Can you share a minimal .rec file to reproduce the error here as requested by @anirudhacharya ?

@marcoabreu marcoabreu added the pr-awaiting-response PR is reviewed and waiting for contributor to respond label Jun 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Data-loading pr-awaiting-response PR is reviewed and waiting for contributor to respond
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants