Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Apple Silicon support #30

Closed
judgeou opened this issue Jul 19, 2022 · 8 comments
Closed

add Apple Silicon support #30

judgeou opened this issue Jul 19, 2022 · 8 comments
Labels
新需求 新功能和需求

Comments

@judgeou
Copy link

judgeou commented Jul 19, 2022

设别和软件信息

  • macOS Monterey 12.4

请自由地描述你的提议(如有多个不同方向的建议,最好分成几个issue)

我看编译涉及到 C++ 和 python,是否短期内适配 M1 CPU有点不切实际?

@xushengfeng
Copy link
Owner

electron是支持m1的,理论上,从源代码编译是可用的,但我手头没设备来编译测试:(

@xushengfeng xushengfeng added the 新需求 新功能和需求 label Jul 19, 2022
@judgeou
Copy link
Author

judgeou commented Jul 19, 2022

我尝试 npx electron . 的时候报了一个错:

Error: The module '/Users/ouzian/project/eSearch/node_modules/robotjs/build/Release/robotjs.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 93. This version of Node.js requires
NODE_MODULE_VERSION 103. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func [as dlopen] (node:electron/js2c/asar_bundle:5:1812)
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1199:18)
    at Object.func [as .node] (node:electron/js2c/asar_bundle:5:1812)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13343)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/ouzian/project/eSearch/node_modules/robotjs/index.js:1:15)
    at Module._compile (node:internal/modules/cjs/loader:1116:14)

我的环境:

  • Macbook Air M1
  • node v16.14.2
  • npm 8.5.0

试过 npm cache clear --force 也不行

@judgeou
Copy link
Author

judgeou commented Jul 19, 2022

我把 node_modules/robotjs/build 删了,执行 npm rebuild robotjs --update-binary 还是一样的错误,难道和 electron 版本有关系吗?

@judgeou
Copy link
Author

judgeou commented Jul 19, 2022

这是我 electron 版本

image

@xushengfeng
Copy link
Owner

npm run rebuild试试

@judgeou
Copy link
Author

judgeou commented Jul 19, 2022

npm run rebuild试试

这下跑起来了

@judgeou
Copy link
Author

judgeou commented Jul 19, 2022

离线 ocr 的时候报了一长串的错误。。。

/Users/ouzian/Library/Application\ Support/eSearch/ocr
Error: Command failed: source /Users/ouzian/Library/Application\ Support/eSearch/ocr/env/bin/activate && /Users/ouzian/Library/Application\ Support/eSearch/ocr/env/bin/python /Users/ouzian/Library/Application\ Support/eSearch/ocr/ppocr/tools/infer/predict_system.py --image_dir="/var/folders/zf/mqv7h2wn0fq6xhr_s5dxcrr00000gn/T/eSearch/ocr.png" --det_model_dir="/Users/ouzian/Library/Application Support/eSearch/ocr/ppocr_model//Users/ouzian/Library/Application\ Support/eSearch/ocr/ppocr_model/inference/ch_PP-OCRv2_det_infer" --rec_model_dir="/Users/ouzian/Library/Application Support/eSearch/ocr/ppocr_model//Users/ouzian/Library/Application\ Support/eSearch/ocr/ppocr_model/inference/ch_PP-OCRv2_rec_infer" --use_gpu=False --rec_char_dict_path="/Users/ouzian/Library/Application Support/eSearch/ocr/ppocr_model/ppocr_keys_v1.txt"
                    
/Users/ouzian/Library/Application Support/eSearch/ocr/env/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:36: DeprecationWarning: NEAREST is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.NEAREST or Dither.NONE instead.
  'nearest': Image.NEAREST,
/Users/ouzian/Library/Application Support/eSearch/ocr/env/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:37: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
  'bilinear': Image.BILINEAR,
/Users/ouzian/Library/Application Support/eSearch/ocr/env/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:38: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
  'bicubic': Image.BICUBIC,
/Users/ouzian/Library/Application Support/eSearch/ocr/env/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:39: DeprecationWarning: BOX is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BOX instead.
  'box': Image.BOX,
/Users/ouzian/Library/Application Support/eSearch/ocr/env/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:40: DeprecationWarning: LANCZOS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.
  'lanczos': Image.LANCZOS,
/Users/ouzian/Library/Application Support/eSearch/ocr/env/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:41: DeprecationWarning: HAMMING is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.HAMMING instead.
  'hamming': Image.HAMMING
Traceback (most recent call last):
  File "/Users/ouzian/Library/Application Support/eSearch/ocr/ppocr/tools/infer/predict_system.py", line 160, in <module>
    main(args)
  File "/Users/ouzian/Library/Application Support/eSearch/ocr/ppocr/tools/infer/predict_system.py", line 108, in main
    text_sys = TextSystem(args)
  File "/Users/ouzian/Library/Application Support/eSearch/ocr/ppocr/tools/infer/predict_system.py", line 46, in __init__
    self.text_detector = predict_det.TextDetector(args)
  File "/Users/ouzian/Library/Application Support/eSearch/ocr/ppocr/tools/infer/predict_det.py", line 107, in __init__
    args, 'det', logger)
  File "/Users/ouzian/Library/Application Support/eSearch/ocr/ppocr/tools/infer/utility.py", line 167, in create_predictor
    model_file_path))
ValueError: not find model file path /Users/ouzian/Library/Application Support/eSearch/ocr/ppocr_model//Users/ouzian/Library/Application\ Support/eSearch/ocr/ppocr_model/inference/ch_PP-OCRv2_det_infer/inference.pdmodel

    at ChildProcess.exithandler (node:child_process:406:12)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
  killed: false,
  code: 1,
  signal: null,
  cmd: 'source /Users/ouzian/Library/Application\\ Support/eSearch/ocr/env/bin/activate && /Users/ouzian/Library/Application\\ Support/eSearch/ocr/env/bin/python /Users/ouzian/Library/Application\\ Support/eSearch/ocr/ppocr/tools/infer/predict_system.py --image_dir="/var/folders/zf/mqv7h2wn0fq6xhr_s5dxcrr00000gn/T/eSearch/ocr.png" --det_model_dir="/Users/ouzian/Library/Application Support/eSearch/ocr/ppocr_model//Users/ouzian/Library/Application\\ Support/eSearch/ocr/ppocr_model/inference/ch_PP-OCRv2_det_infer" --rec_model_dir="/Users/ouzian/Library/Application Support/eSearch/ocr/ppocr_model//Users/ouzian/Library/Application\\ Support/eSearch/ocr/ppocr_model/inference/ch_PP-OCRv2_rec_infer" --use_gpu=False --rec_char_dict_path="/Users/ouzian/Library/Application Support/eSearch/ocr/ppocr_model/ppocr_keys_v1.txt"\n' +
    '                    '
}

而且第一次运行安装的 python 3.7 也不是 arm 版本的,似乎还会有不少问题

@xushengfeng
Copy link
Owner

1.7.2版本下的ocr能正常工作吗

@xushengfeng xushengfeng mentioned this issue Aug 6, 2022
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
新需求 新功能和需求
Projects
None yet
Development

No branches or pull requests

2 participants