creotiv / computer_vision

Some computer vision tutorials for my articles
119 stars 77 forks source link

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

Open barhaiya11 opened 5 years ago

barhaiya11 commented 5 years ago

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 commented 9 months ago

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)