guanshuicheng / invoice

Collaboration with wangxupeng(https://github.com/wangxupeng)
MIT License
1.81k stars 447 forks source link

No such file or directory #44

Closed jcntec closed 2 years ago

jcntec commented 2 years ago

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\ZKRH001\Desktop\invoice-master\models\ocr-lstm.pth'

Traceback (most recent call last): File "C:\Users\ZKRH001\Desktop\invoice-master\app.py", line 14, in from model_post_type import ocr as OCR File "C:\Users\ZKRH001\Desktop\invoice-master\model_post_type.py", line 10, in from crnn.crnn_torch import crnnOcr as crnnOcr ##torch版本ocr File "C:\Users\ZKRH001\Desktop\invoice-master\crnn\crnn_torch.py", line 38, in model,converter = crnnSource() File "C:\Users\ZKRH001\Desktop\invoice-master\crnn\crnn_torch.py", line 26, in crnnSource trainWeights = torch.load(ocrModel,map_location=lambda storage, loc: storage) File "C:\Users\ZKRH001\AppData\Roaming\Python\Python39\site-packages\torch\serialization.py", line 594, in load with _open_file_like(f, 'rb') as opened_file: File "C:\Users\ZKRH001\AppData\Roaming\Python\Python39\site-packages\torch\serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "C:\Users\ZKRH001\AppData\Roaming\Python\Python39\site-packages\torch\serialization.py", line 211, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\ZKRH001\Desktop\invoice-master\models\ocr-lstm.pth' 请按任意键继续. . .

guanshuicheng commented 2 years ago

请先下载模型文件放至对应文件夹