Wovchena / text-detection-fots.pytorch

FOTS text detection branch reimplementation, hmean: 83.3%
79 stars 21 forks source link

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

Open chakrabortyrajatsubhra opened 4 years ago

chakrabortyrajatsubhra commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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.