停止打印警告消息“正在使用 CPU。注意:该模块使用 GPU 时速度更快。”

发布于 2025-01-10 00:01:39 字数 169 浏览 0 评论 0原文

我正在使用优秀的 EasyOCR 模块运行 Python 程序。它依赖 PyTorch 进行图像检测,每次运行它时,它都会在每次迭代时生成警告:“使用 CPU。注意:使用 GPU 时该模块要快得多。”。

我可以在代码中添加什么来停止此输出而不停止其他输出?我没有 GPU,所以这不是一个选择。

I am running a Python program using the excellent EasyOCR module. It relies on PyTorch for image detection and every time I run it, it produces a warning: "Using CPU. Note: This module is much faster with a GPU." for each iteration.

What can I add to my code to stop this output without stopping other output? I don't have a GPU so that is not an option.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

抚你发端 2025-01-17 00:01:39

在查看源代码后,我注意到< code>verbose 默认设置为 True在构造函数中。

设置 verbose=False 后,消息将停止显示。

reader = easyocr.Reader(['en'], gpu=False, verbose=False)

After looking into the source code, I noticed that verbose is set to True by default in the constructor.

After setting verbose=False the message stops appearing.

reader = easyocr.Reader(['en'], gpu=False, verbose=False)
笑看君怀她人 2025-01-17 00:01:39

我认为有一个命令行参数--gpu=false。你尝试过吗?

I think there is a command line parameter --gpu=false. Have you tried that?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文