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

【系统路径缺失】无法完成初始化,PaddleOCR-json.exe报错chcp不是内部或外部命令 #9

Closed
Oldsport-996 opened this issue Sep 1, 2022 · 14 comments

Comments

@Oldsport-996
Copy link

您好 今天使用卡初始化了 不知道什么原因

@hiroi-sora
Copy link
Owner

hiroi-sora commented Sep 1, 2022

请问以前使用是正常的吗?如果是,可能配置文件被修改过,而且参数不正确。尝试下载最新版软件,看看可否运行。

如果依然不行,尝试打开 PaddleOCR-json 文件夹下的识别引擎 PaddleOCR_json.exe ,看看它有无报错。如果有报错,则可能你的电脑安装(注册)了某些运行库与引擎产生了冲突。方便的话,把报错内容发上来。

@andongya95
Copy link

andongya95 commented Sep 9, 2022

作者大大您好 我在下载了1.2.6版本后也出现了初始化失败的问题
在读图后直接运行、选择识别区域、或者剪切板读取时都有同样的初始化失败报错
然后我运行了PaddleOCR_json.exe 并没有报错
最后我下回了1.2.5版本后还是可以使用的
我怀疑是 更新PaddleOCR-json模块至v1.2.0 之后有兼容问题?

@hiroi-sora
Copy link
Owner

@andongya95

可否将1.2.6初始化失败的弹窗截图放上来?我想看看它的信息

@Oldsport-996
Copy link
Author

image
您好 他就是一直初始化,然后软件没什么反应

@hiroi-sora
Copy link
Owner

运行PaddleOCR_json.exe时,是不是打印一大串日志、最后显示 OCR init completed. ?

image

@Oldsport-996
Copy link
Author

image

@Oldsport-996
Copy link
Author

image
这个任务也没法停止,一直显示 正在停止,右键关闭还关闭不了,只能用任务管理器强制关闭软件

@hiroi-sora
Copy link
Owner

'chcp' 不是内部或外部命令

意料之外的问题。你电脑打开cmd,输入where chcp,看看会不会输出正确的路径?
如果没有,尝试将 C:\Windows\system32 加入系统路径
如果有,尝试将 PaddleOCR_json 文件夹加入系统路径
参考:https://blog.csdn.net/weixin_38314865/article/details/84594065

这个任务也没法停止,一直显示 正在停止

OK,以后会加入超时监控以防止程序因未知原因卡死

@Oldsport-996
Copy link
Author

嗯 可以了 谢谢作者大大,我将C:\Windows\system32 加入系统路径 后 可以进行识别了

@andongya95
Copy link

@hiroi-sora
我的PaddleOCR_json.exe运行后得到的是OCR init completed和图中一致
我也试了把文件夹加入系统路径,现在依然还是初始化失败的报错

@hiroi-sora
Copy link
Owner

hiroi-sora commented Sep 9, 2022

@andongya95
是的,你的问题跟楼主不一样,与系统路径无关。可否在你机器上运行下述代码,看看有无问题

import os
import subprocess  # 进程,管道

# exePath = r"填入PaddleOCR_json.exe的路径"
exePath = r"D:\MyCode\PythonCode\Umi-OCR\PaddleOCR-json\PaddleOCR_json.exe"

cwd = os.path.abspath(os.path.join(exePath, os.pardir))
print(exePath, cwd)
popen = subprocess.Popen(  # 打开管道
    exePath, cwd=cwd,
    stdin=subprocess.PIPE,
    stdout=subprocess.PIPE,
)
for i in range(1000):
    if not popen.poll() == None:  # 子进程已退出,初始化失败
        print('子进程已退出,初始化失败!')
        break
    initStr = popen.stdout.readline().decode('ascii', errors='ignore')
    print(f'{i} : {initStr}')
    if 'OCR init completed.' in initStr:
        print(f'初始化成功!')
        break
    if i >= 999:
        print(f'输出条数异常,初始化失败!')
if popen.poll():
    popen.kill()

@andongya95
Copy link

andongya95 commented Sep 9, 2022

@hiroi-sora
我跑了之后卡在了第一次loop里
0 : Active code page: 65001
现在暂时还没动过

更新:
我发现是进程卡了
我重新跑了之后得到了
0 : Active code page: 65001
1 : OCR init completed.
初始化成功!

@hiroi-sora
Copy link
Owner

hiroi-sora commented Sep 9, 2022

那既然这段demo能跑,Umi-OCR理应没问题呀

试试直接调用 callingOCR.py ,在最后加入一行

ocr = CallingOCR('填入PaddleOCR_json.exe的路径')

把第46行的initStr打印出来
把第49行的 # print(f'初始化OCR成功,进程号为{self.ret.pid}') 取消注释

看能不能初始化成功

@andongya95
Copy link

andongya95 commented Sep 9, 2022

image

e[37m---    fused 0 elementwise_add with relu activatione[0m
e[37m---    fused 0 elementwise_add with tanh activatione[0m
e[37m---    fused 0 elementwise_add with leaky_relu activatione[0m
e[37m---    fused 0 elementwise_add with swish activatione[0m
e[37m---    fused 0 elementwise_add with hardswish activatione[0m
e[37m---    fused 0 elementwise_add with sqrt activatione[0m
e[37m---    fused 0 elementwise_add with abs activatione[0m
e[37m---    fused 0 elementwise_add with clip activatione[0m
e[37m---    fused 0 elementwise_add with gelu activatione[0m
e[37m---    fused 0 elementwise_add with relu6 activatione[0m
e[37m---    fused 0 elementwise_add with sigmoid activatione[0m
e[37m---    fused 0 elementwise_sub with relu activatione[0m
e[37m---    fused 0 elementwise_sub with tanh activatione[0m
e[37m---    fused 0 elementwise_sub with leaky_relu activatione[0m
e[37m---    fused 0 elementwise_sub with swish activatione[0m
e[37m---    fused 0 elementwise_sub with hardswish activatione[0m
e[37m---    fused 0 elementwise_sub with sqrt activatione[0m
e[37m---    fused 0 elementwise_sub with abs activatione[0m
e[37m---    fused 0 elementwise_sub with clip activatione[0m
e[37m---    fused 0 elementwise_sub with gelu activatione[0m
e[37m---    fused 0 elementwise_sub with relu6 activatione[0m
e[37m---    fused 0 elementwise_sub with sigmoid activatione[0m
e[37m---    fused 0 elementwise_mul with relu activatione[0m
e[37m---    fused 0 elementwise_mul with tanh activatione[0m
e[37m---    fused 0 elementwise_mul with leaky_relu activatione[0m
e[37m---    fused 0 elementwise_mul with swish activatione[0m
e[37m---    fused 0 elementwise_mul with hardswish activatione[0m
e[37m---    fused 0 elementwise_mul with sqrt activatione[0m
e[37m---    fused 0 elementwise_mul with abs activatione[0m
e[37m---    fused 0 elementwise_mul with clip activatione[0m
e[37m---    fused 0 elementwise_mul with gelu activatione[0m
e[37m---    fused 0 elementwise_mul with relu6 activatione[0m
e[37m---    fused 0 elementwise_mul with sigmoid activatione[0m
e[37m---    fused 0 elementwise_add with relu activatione[0m
e[37m---    fused 0 elementwise_add with tanh activatione[0m
e[37m---    fused 0 elementwise_add with leaky_relu activatione[0m
e[37m---    fused 0 elementwise_add with swish activatione[0m
e[37m---    fused 0 elementwise_add with hardswish activatione[0m
e[37m---    fused 0 elementwise_add with sqrt activatione[0m
e[37m---    fused 0 elementwise_add with abs activatione[0m
e[37m---    fused 0 elementwise_add with clip activatione[0m
e[37m---    fused 0 elementwise_add with gelu activatione[0m
e[37m---    fused 0 elementwise_add with relu6 activatione[0m
e[37m---    fused 0 elementwise_add with sigmoid activatione[0m
e[37m---    fused 0 elementwise_sub with relu activatione[0m
e[37m---    fused 0 elementwise_sub with tanh activatione[0m
e[37m---    fused 0 elementwise_sub with leaky_relu activatione[0m
e[37m---    fused 0 elementwise_sub with swish activatione[0m
e[37m---    fused 0 elementwise_sub with hardswish activatione[0m
e[37m---    fused 0 elementwise_sub with sqrt activatione[0m
e[37m---    fused 0 elementwise_sub with abs activatione[0m
e[37m---    fused 0 elementwise_sub with clip activatione[0m
e[37m---    fused 0 elementwise_sub with gelu activatione[0m
e[37m---    fused 0 elementwise_sub with relu6 activatione[0m
e[37m---    fused 0 elementwise_sub with sigmoid activatione[0m
e[37m---    fused 0 elementwise_mul with relu activatione[0m
e[37m---    fused 0 elementwise_mul with tanh activatione[0m
e[37m---    fused 0 elementwise_mul with leaky_relu activatione[0m
e[37m---    fused 0 elementwise_mul with swish activatione[0m
e[37m---    fused 0 elementwise_mul with hardswish activatione[0m
e[37m---    fused 0 elementwise_mul with sqrt activatione[0m
e[37m---    fused 0 elementwise_mul with abs activatione[0m
e[37m---    fused 0 elementwise_mul with clip activatione[0m
e[37m---    fused 0 elementwise_mul with gelu activatione[0m
e[37m---    fused 0 elementwise_mul with relu6 activatione[0m
e[37m---    fused 0 elementwise_mul with sigmoid activatione[0m
0 : Active code page: 65001

1 : OCR init completed.

初始化成功!
e[37m---    fused 0 elementwise_add with relu activatione[0m
e[37m---    fused 0 elementwise_add with tanh activatione[0m
e[37m---    fused 0 elementwise_add with leaky_relu activatione[0m
e[37m---    fused 0 elementwise_add with swish activatione[0m
e[37m---    fused 0 elementwise_add with hardswish activatione[0m
e[37m---    fused 0 elementwise_add with sqrt activatione[0m
e[37m---    fused 0 elementwise_add with abs activatione[0m
e[37m---    fused 0 elementwise_add with clip activatione[0m
e[37m---    fused 0 elementwise_add with gelu activatione[0m
e[37m---    fused 0 elementwise_add with relu6 activatione[0m
e[37m---    fused 0 elementwise_add with sigmoid activatione[0m
e[37m---    fused 0 elementwise_sub with relu activatione[0m
e[37m---    fused 0 elementwise_sub with tanh activatione[0m
e[37m---    fused 0 elementwise_sub with leaky_relu activatione[0m
e[37m---    fused 0 elementwise_sub with swish activatione[0m
e[37m---    fused 0 elementwise_sub with hardswish activatione[0m
e[37m---    fused 0 elementwise_sub with sqrt activatione[0m
e[37m---    fused 0 elementwise_sub with abs activatione[0m
e[37m---    fused 0 elementwise_sub with clip activatione[0m
e[37m---    fused 0 elementwise_sub with gelu activatione[0m
e[37m---    fused 0 elementwise_sub with relu6 activatione[0m
e[37m---    fused 0 elementwise_sub with sigmoid activatione[0m
e[37m---    fused 0 elementwise_mul with relu activatione[0m
e[37m---    fused 0 elementwise_mul with tanh activatione[0m
e[37m---    fused 0 elementwise_mul with leaky_relu activatione[0m
e[37m---    fused 0 elementwise_mul with swish activatione[0m
e[37m---    fused 0 elementwise_mul with hardswish activatione[0m
e[37m---    fused 0 elementwise_mul with sqrt activatione[0m
e[37m---    fused 0 elementwise_mul with abs activatione[0m
e[37m---    fused 0 elementwise_mul with clip activatione[0m
e[37m---    fused 0 elementwise_mul with gelu activatione[0m
e[37m---    fused 0 elementwise_mul with relu6 activatione[0m
e[37m---    fused 0 elementwise_mul with sigmoid activatione[0m
e[37m---    fused 0 elementwise_add with relu activatione[0m
e[37m---    fused 0 elementwise_add with tanh activatione[0m
e[37m---    fused 0 elementwise_add with leaky_relu activatione[0m
e[37m---    fused 0 elementwise_add with swish activatione[0m
e[37m---    fused 0 elementwise_add with hardswish activatione[0m
e[37m---    fused 0 elementwise_add with sqrt activatione[0m
e[37m---    fused 0 elementwise_add with abs activatione[0m
e[37m---    fused 0 elementwise_add with clip activatione[0m
e[37m---    fused 0 elementwise_add with gelu activatione[0m
e[37m---    fused 0 elementwise_add with relu6 activatione[0m
e[37m---    fused 0 elementwise_add with sigmoid activatione[0m
e[37m---    fused 0 elementwise_sub with relu activatione[0m
e[37m---    fused 0 elementwise_sub with tanh activatione[0m
e[37m---    fused 0 elementwise_sub with leaky_relu activatione[0m
e[37m---    fused 0 elementwise_sub with swish activatione[0m
e[37m---    fused 0 elementwise_sub with hardswish activatione[0m
e[37m---    fused 0 elementwise_sub with sqrt activatione[0m
e[37m---    fused 0 elementwise_sub with abs activatione[0m
e[37m---    fused 0 elementwise_sub with clip activatione[0m
e[37m---    fused 0 elementwise_sub with gelu activatione[0m
e[37m---    fused 0 elementwise_sub with relu6 activatione[0m
e[37m---    fused 0 elementwise_sub with sigmoid activatione[0m
e[37m---    fused 0 elementwise_mul with relu activatione[0m
e[37m---    fused 0 elementwise_mul with tanh activatione[0m
e[37m---    fused 0 elementwise_mul with leaky_relu activatione[0m
e[37m---    fused 0 elementwise_mul with swish activatione[0m
e[37m---    fused 0 elementwise_mul with hardswish activatione[0m
e[37m---    fused 0 elementwise_mul with sqrt activatione[0m
e[37m---    fused 0 elementwise_mul with abs activatione[0m
e[37m---    fused 0 elementwise_mul with clip activatione[0m
e[37m---    fused 0 elementwise_mul with gelu activatione[0m
e[37m---    fused 0 elementwise_mul with relu6 activatione[0m
e[37m---    fused 0 elementwise_mul with sigmoid activatione[0m
Active code page: 65001

OCR init completed.

初始化OCR成功,进程号为12148

@hiroi-sora hiroi-sora changed the title 您好 今天使用卡初始化了 不知道什么原因 【系统路径缺失】无法完成初始化,PaddleOCR-json.exe报错chcp不是内部或外部命令 Sep 9, 2022
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