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

Error in pickle.dump(result, fp) #3

Open
barhaiya11 opened this issue Apr 12, 2019 · 1 comment
Open

Error in pickle.dump(result, fp) #3

barhaiya11 opened this issue Apr 12, 2019 · 1 comment

Comments

@barhaiya11
Copy link

I am running this code to extract the features of word written in hindi using Spyder but it is showing me the error:

File "G:/devanagari_ocr-master/honey/code.py", line 50, in batch_extractor
pickle.dump(result, fp)

TypeError: write() argument must be str, not bytes

Please resolve this asap

@dlaoy
Copy link

dlaoy commented Jan 6, 2024

If you are python3 you can do this.

with open(pickled_db_path,'wb') as fp:
pickle.dump(result,fp)

Likewise, the same goes for reading.

with open(pickled_db_path,'rb') as fp :
self.data = pickle.load(fp)

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