computer_vision icon indicating copy to clipboard operation
computer_vision copied to clipboard

Error in pickle.dump(result, fp)

Open barhaiya11 opened this issue 5 years ago • 1 comments

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

barhaiya11 avatar Apr 12 '19 04:04 barhaiya11

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)

dlaoy avatar Jan 06 '24 09:01 dlaoy