Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opencv Error! #14

Open
zobeirraisi opened this issue Sep 26, 2019 · 10 comments
Open

Opencv Error! #14

zobeirraisi opened this issue Sep 26, 2019 · 10 comments

Comments

@zobeirraisi
Copy link

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

@backtime92
Copy link
Owner

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

@zobeirraisi
Copy link
Author

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)

@backtime92
Copy link
Owner

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

@zobeirraisi
Copy link
Author

zobeirraisi commented Sep 26, 2019 via email

@backtime92
Copy link
Owner

@zobeirraisi Could you show me your whole error information

@zobeirraisi
Copy link
Author

zobeirraisi commented Sep 26, 2019 via email

@backtime92
Copy link
Owner

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

@zobeirraisi
Copy link
Author

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

@lylaaa
Copy link

lylaaa commented Nov 27, 2019

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.

@duxiangcheng
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants