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

Fix error can't open image files in Python3. #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

youdiandai
Copy link

1.We tried to use your CRNN network for training, and the Python version we used was 3.7.2,
in the process of generating the LMDB file, I noticed that......an error will occur, Python
3 need to add a "b" flag bit when reading bit type data.
"""
with open(imagePath, 'r') as f:
imageBin = f.read()

"""

  1. I noticed that there was an error when you directly pushed STR into LMDB when I put data
    into LMDB.LMDB should only accept data of bytes type, so we have to encode data asbyte type.

3.In the process of reading data from LMDB, since the data read out is bytes type, the
string operation cannot be carried out directly, and the bytes type decode needs to be
str.

4.The data sets we used is different form yours, so some of the characters in yout
"alphabets.pu"cannot be found and cause application error. I wrote a function to
generate the corresponding "apphabets.py" module according to the data sets wo imprvoe
compatibility.

Add a function to create alphabets.py from dataset
@lironghua318
Copy link

for 3
there is already decode in

  • "train.py", line 55, in val
    list_1.append(i.decode('utf-8','strict'))
  • ''/lib/convert.py", line 43, in encode
    item = item.decode('utf-8', 'strict')

@youdiandai
Copy link
Author

it been a long time since i create this merge.I cant rember it well.send me email if you need to discuss,my email : [email protected]

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

Successfully merging this pull request may close these issues.

2 participants