CRAFT-Reimplementation icon indicating copy to clipboard operation
CRAFT-Reimplementation copied to clipboard

Opencv Error!

Open zobeirraisi opened this issue 5 years ago • 10 comments

I get the following error during training of synth and IC15 , after updating the new data_loader.py ., It was working before the new update. I try to install different version of OpenCV , it didn't solve.

cv2.error: OpenCV(3.4.2) /io/opencv/modules/imgproc/src/color.hpp:253: error: (-215:Assertion failed) VScn::contains(scn) && VDcn::contains(dcn) && VDepth::contains(depth) in function 'CvtHelper

zobeirraisi avatar Sep 26 '19 02:09 zobeirraisi

@zobeirraisi Sorry! I have released the code for IC15 just now.

backtime92 avatar Sep 26 '19 02:09 backtime92

Thanks for your quick reply, 👍 Now I got this error:

for index, (real_images, real_gh_label, real_gah_label, real_mask) in enumerate(real_data_loader): ValueError: too many values to unpack (expected 4)

zobeirraisi avatar Sep 26 '19 03:09 zobeirraisi

@zobeirraisi Because it returns the confidence, you can change it as below: for index, (real_images, real_gh_label, real_gah_label, real_mask) in enumerate(real_data_loader): syn_images, syn_gh_label, syn_gah_label, syn_mask, __ = next(batch_syn)

backtime92 avatar Sep 26 '19 04:09 backtime92

I am still receiving the above “openCV error “ message in data_loader.

On Thu, Sep 26, 2019 at 12:00 AM backtime92 [email protected] wrote:

@zobeirraisi https://github.com/zobeirraisi Because it returns the confidence, you can change it as below: for index, (real_images, real_gh_label, real_gah_label, real_mask) in enumerate(real_data_loader): syn_images, syn_gh_label, syn_gah_label, syn_mask, __ = next(batch_syn)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/backtime92/CRAFT-Reimplementation/issues/14?email_source=notifications&email_token=AD7CNRFUQWPXXEO7Y5TAOPDQLQXVPA5CNFSM4I2UIU2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7UGB4Q#issuecomment-535322866, or mute the thread https://github.com/notifications/unsubscribe-auth/AD7CNRBCYXRNO4XE6SXZONTQLQXVPANCNFSM4I2UIU2A .

zobeirraisi avatar Sep 26 '19 12:09 zobeirraisi

@zobeirraisi Could you show me your whole error information

backtime92 avatar Sep 26 '19 12:09 backtime92

This is the whole error for both trainic15 and trainSyndata:

==== syn_images, syn_gh_label, syn_gah_label, syn_mask,__ = next(batch_syn) File "/home/karim/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 346, in next data = self.dataset_fetcher.fetch(index) # may raise StopIteration File "/home/karim/.local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/karim/.local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/karim/Desktop/Text/Detection/CRAFT/CRAFT-Reimplementation/data_loader.py", line 374, in getitem return self.pull_item(index) File "/home/karim/Desktop/Text/Detection/CRAFT/CRAFT-Reimplementation/data_loader.py", line 319, in pull_item image, character_bboxes, words, confidence_mask, confidences = self.load_image_gt_and_confidencemask(index) File "/home/karim/Desktop/Text/Detection/CRAFT/CRAFT-Reimplementation/data_loader.py", line 390, in load_image_gt_and_confidencemask image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) cv2.error: OpenCV(4.1.1) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function ‘cvtColor'

On Sep 26, 2019, at 8:36 AM, backtime92 [email protected] wrote:

@zobeirraisi https://github.com/zobeirraisi Could you show me your whole error information

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/backtime92/CRAFT-Reimplementation/issues/14?email_source=notifications&email_token=AD7CNRBJ2WMQXNHCKLYYYZDQLSUDRA5CNFSM4I2UIU2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7VM7SI#issuecomment-535482313, or mute the thread https://github.com/notifications/unsubscribe-auth/AD7CNRHHIAT3ROSKXBBL44LQLSUDRANCNFSM4I2UIU2A.

zobeirraisi avatar Sep 26 '19 12:09 zobeirraisi

@zobeirraisi I think maybe is your image path error,please check your data path.

backtime92 avatar Sep 26 '19 12:09 backtime92

It solved thanks, Yes, my synthText path was wrong!

zobeirraisi avatar Sep 26 '19 14:09 zobeirraisi

It solved thanks, Yes, my synthText path was wrong!

This is the whole error for both trainic15 and trainSyndata: ==== syn_images, syn_gh_label, syn_gah_label, syn_mask,__ = next(batch_syn) File "/home/karim/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 346, in next data = self.dataset_fetcher.fetch(index) # may raise StopIteration File "/home/karim/.local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/karim/.local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/karim/Desktop/Text/Detection/CRAFT/CRAFT-Reimplementation/data_loader.py", line 374, in getitem return self.pull_item(index) File "/home/karim/Desktop/Text/Detection/CRAFT/CRAFT-Reimplementation/data_loader.py", line 319, in pull_item image, character_bboxes, words, confidence_mask, confidences = self.load_image_gt_and_confidencemask(index) File "/home/karim/Desktop/Text/Detection/CRAFT/CRAFT-Reimplementation/data_loader.py", line 390, in load_image_gt_and_confidencemask image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) cv2.error: OpenCV(4.1.1) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function ‘cvtColor' ======= On Sep 26, 2019, at 8:36 AM, backtime92 @.***> wrote: @zobeirraisi https://github.com/zobeirraisi Could you show me your whole error information — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#14?email_source=notifications&email_token=AD7CNRBJ2WMQXNHCKLYYYZDQLSUDRA5CNFSM4I2UIU2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7VM7SI#issuecomment-535482313>, or mute the thread https://github.com/notifications/unsubscribe-auth/AD7CNRHHIAT3ROSKXBBL44LQLSUDRANCNFSM4I2UIU2A.

I meet the same error,but my synthtext path is right,do you have some advice?thanks.

lylaaa avatar Nov 27 '19 09:11 lylaaa

It solved thanks, Yes, my synthText path was wrong!

This is the whole error for both trainic15 and trainSyndata: ==== syn_images, syn_gh_label, syn_gah_label, syn_mask,__ = next(batch_syn) File "/home/karim/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 346, in next data = self.dataset_fetcher.fetch(index) # may raise StopIteration File "/home/karim/.local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/karim/.local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/karim/Desktop/Text/Detection/CRAFT/CRAFT-Reimplementation/data_loader.py", line 374, in getitem return self.pull_item(index) File "/home/karim/Desktop/Text/Detection/CRAFT/CRAFT-Reimplementation/data_loader.py", line 319, in pull_item image, character_bboxes, words, confidence_mask, confidences = self.load_image_gt_and_confidencemask(index) File "/home/karim/Desktop/Text/Detection/CRAFT/CRAFT-Reimplementation/data_loader.py", line 390, in load_image_gt_and_confidencemask image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) cv2.error: OpenCV(4.1.1) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function ‘cvtColor' ======= On Sep 26, 2019, at 8:36 AM, backtime92 @.***> wrote: @zobeirraisi https://github.com/zobeirraisi Could you show me your whole error information — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#14?email_source=notifications&email_token=AD7CNRBJ2WMQXNHCKLYYYZDQLSUDRA5CNFSM4I2UIU2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7VM7SI#issuecomment-535482313>, or mute the thread https://github.com/notifications/unsubscribe-auth/AD7CNRHHIAT3ROSKXBBL44LQLSUDRANCNFSM4I2UIU2A.

I meet the same error,but my synthtext path is right,do you have some advice?thanks.

I also meet the same error. I found some images that are suffixed with .gif. You can delete the images. I hope the advice is useful to you.

duxiangcheng avatar Jan 12 '20 02:01 duxiangcheng