pensieve icon indicating copy to clipboard operation
pensieve copied to clipboard

Failed when start memos.commands serve

Open xyb opened this issue 1 year ago • 4 comments

Log:

│ /Users/xyb/projects/pensieve/memos/plugins/ocr/main.py:232 in init_plugin                                        │
│                                                                                                                  │
│   229 │   │   │   ocr = RapidOCR(config_path=temp_config_path)                                                   │
│   230 │   │   else:                                                                                              │
│   231 │   │   │   from rapidocr_onnxruntime import RapidOCR                                                      │
│ ❱ 232 │   │   │   ocr = RapidOCR(config_path=temp_config_path)                                                   │
│   233 │   │   thread_pool = ThreadPoolExecutor(max_workers=concurrency)                                          │
│   234 │                                                                                                          │
│   235 │   logger.info("OCR plugin initialized")                                                                  │

│ /Users/xyb/.virtualenvs/pensieve/lib/python3.12/site-packages/rapidocr_onnxruntime/main.py:60 in __init__        │
│                                                                                                                  │
│    57 │   │   self.text_rec = TextRecognizer(config["Rec"])                                                      │
│    58 │   │                                                                                                      │
│    59 │   │   self.load_img = LoadImage()                                                                        │
│ ❱  60 │   │   self.max_side_len = global_config["max_side_len"]                                                  │
│    61 │   │   self.min_side_len = global_config["min_side_len"]                                                  │
│    62 │                                                                                                          │
│    63 │   def __call__(                                                                                          │

KeyError: 'max_side_len'

versions:

❯ python3 --version
Python 3.12.4

❯ pip freeze|grep rapidocr
rapidocr-onnxruntime==1.3.25

xyb avatar Nov 18 '24 07:11 xyb

Downgrade to rapidocr-onnxruntime==1.3.24 will fix this issue.

xyb avatar Nov 18 '24 07:11 xyb

The same issue exists on Windows as well. Use pip install rapidocr_openvino==1.3.24 to fix.

noonisy avatar Nov 19 '24 09:11 noonisy

It is fixed. Please update to 0.19.0.

arkohut avatar Nov 19 '24 15:11 arkohut

It is fixed. Please update to 0.19.0.

Thanks. I noticed that rapidocr_onnxruntime has been updated to version 1.4.0 today, but the latest version of rapidocr_openvino is still 1.3.26. (Are you sure that rapidocr_openvino has been updated?😂) https://pypi.org/project/rapidocr-openvino/#history

noonisy avatar Nov 19 '24 15:11 noonisy

It's fixed in 0.19.1 😢

arkohut avatar Nov 20 '24 03:11 arkohut

It works!

xyb avatar Nov 20 '24 09:11 xyb