You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
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_
The text was updated successfully, but these errors were encountered:
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.
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_
The text was updated successfully, but these errors were encountered: