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

报错 #24

Closed
PKQ1688 opened this issue May 14, 2020 · 12 comments
Closed

报错 #24

PKQ1688 opened this issue May 14, 2020 · 12 comments

Comments

@PKQ1688
Copy link

PKQ1688 commented May 14, 2020

Traceback (most recent call last):
File "tools/infer/predict_system.py", line 15, in
import utility
File "PaddleOCR/tools/infer/utility.py", line 17, in
from ppocr.utils.utility import initial_logger
ModuleNotFoundError: No module named 'ppocr'

@dyning
Copy link
Collaborator

dyning commented May 14, 2020

需要设置PYTHONPATH环境变量

export PYTHONPATH=.

@PKQ1688
Copy link
Author

PKQ1688 commented May 14, 2020

export PYTHONPATH=.;
python -m tools.infer.predict_system
--image_dir="doc/imgs/"
--det_model_dir="inference/det/"
--rec_model_dir="inference/rec/"

@PKQ1688
Copy link
Author

PKQ1688 commented May 14, 2020

使用sh脚本 报ModuleNotFoundError: No module named 'utility'
test.sh: 5: test.sh: --rec_model_dir=inference/rec/: not found
的错误

@LDOUBLEV
Copy link
Collaborator

使用sh脚本 报ModuleNotFoundError: No module named 'utility'
test.sh: 5: test.sh: --rec_model_dir=inference/rec/: not found
的错误

需要先下载inference模型,确保下载 识别的inference模型 在inference/rec/目录下

@PKQ1688
Copy link
Author

PKQ1688 commented May 14, 2020

下载了 不使用shell脚本直接命令行运行就可以

@LDOUBLEV
Copy link
Collaborator

下载了 不使用shell脚本直接命令行运行就可以

好的,我们会排查下问题

@PKQ1688
Copy link
Author

PKQ1688 commented May 14, 2020

顺便问一下 ,可以跑在cpu上面吗

@LDOUBLEV
Copy link
Collaborator

顺便问一下 ,可以跑在cpu上面吗

可以在CPU上运行,但是目前CPU上的结果与GPU有稍许diff,问题正在处理中

@PKQ1688
Copy link
Author

PKQ1688 commented May 14, 2020

好的 运行在cpu上的命令能发一下吗

@LDOUBLEV
Copy link
Collaborator

LDOUBLEV commented May 14, 2020

好的 运行在cpu上的命令能发一下吗

如果是跑CPU的inference,可以通过设置tools/infer/utility.py中的--use_gpu参数实现,如下:

export PYTHONPATH=.  && python  tools/infer/predict_rec.py --image_dir="/demo.jpg" --rec_model_dir="./inference/rec/"  --use_gpu=False

注:CPU上效果偏差,正在紧急修复中

@PKQ1688
Copy link
Author

PKQ1688 commented May 14, 2020

好的 谢谢 辛苦了 我先看看效果 再看看代码

@LDOUBLEV
Copy link
Collaborator

好的 谢谢 辛苦了 我先看看效果 再看看代码

顺便问一下 ,可以跑在cpu上面吗

CPU与GPU运行结果有diff的bug已修复,请拉取最新代码试下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants