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

CANNOT FIND ANYTHING IN MATCHES IN LINE NUMBER 168 OF DATASETS.PY #21

Open
chakrabortyrajatsubhra opened this issue Aug 18, 2020 · 3 comments

Comments

@chakrabortyrajatsubhra
Copy link

matches = self.pattern.findall(line)[0]
IndexError: list index out of range

THIS IS THE ERROR I AM GETTING WHILE TRAINING THE MODEL-- I HAVE TRIED TO PRINT WHAT GOES INSIDE MATCHES AND IT IS PRINTING MATCHES[] MEANING MATCHES IS EMPTY. CAN YOU TELL ME ---
A) WHAT IS THE ROLE OF MATCHES IN THE CODE?
B) I HAVE FOLLOWED ALL THE STEPS ACCORDING TO THE INSTRUCTIONS STILL I AM GETTING AN INDEX ERROR WHY?

YOUR HELP WOULD MEAN A LOT TO ME.

@Wovchena
Copy link
Owner

A) matches = self.pattern.findall(line)[0] parses a given line to extract coordinates of text and text label from a ground truth file.
B) The error may occur if the line is empty or doesn't follow an expected pattern (which is 8 numbers and text label separated by , according to self.pattern = re.compile('^' + '(\\d+),' * 8 + '(.+)$')).

My suggestion is to check what line has when the error happens and verify if it matches to one of lines in the corresponding ground truth file.

@chakrabortyrajatsubhra
Copy link
Author

checked out the ground truth turns out that the format was wrong there and corrrected it but after running it half way i am getting this new error -- "operands could not be broadcast together with shapes (0,) (2,) (0,)".

@Wovchena
Copy link
Owner

Shape of (0,) means there is a one dimensional empty array. Such arrays shouldn't appear. You should figure out where that array comes from and handle it.

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

2 participants