Open merria28 opened 6 years ago
同问,自己也遇到这个错误,请问您解决了吗
改成 f = open('./chinese_labels', 'rb') 试试
如果用的python3,可以修改如下: f = open('./chinese_labels', 'rb') label_dict = pickle.load(f, encoding=''utf-8'')
@AziCat @Chen823 谢谢你们,我也是这么做的,非常感谢
我改了是不行的
label_dict = pickle.load(f, encoding="utf-8") EOFError: Ran out of input 这是错误信息
with open('./chinese_labels', 'r') as data_file:
label_dict = pickle.load(StrToBytes(data_file))
def get_label_dict(): f = open('./chinese_labels', 'r') label_dict = pickle.load(f)
label_dict = str.encode(pickle.load(f))
提示下面的错误: Traceback (most recent call last): File "F:/OCR/CPS-OCR-Engine-master/ocr/Chinese_OCR.py", line 411, in
tf.app.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
_sys.exit(main(argv))
File "F:/OCR/CPS-OCR-Engine-master/ocr/Chinese_OCR.py", line 390, in main
label_dict = get_label_dict()
File "F:/OCR/CPS-OCR-Engine-master/ocr/Chinese_OCR.py", line 335, in get_label_dict
label_dict = pickle.load(f)
TypeError: a bytes-like object is required, not 'str'
这个该怎么改?