PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
22.17k stars 5.56k forks source link

PaddleOCR日志如何关闭 #50113

Open zhaocanglong opened 1 year ago

zhaocanglong commented 1 year ago

请提出你的问题 Please ask your question

Windows11 CPU 文件: ocr_rec.cpp 函数名: CRNNRecognizer::Run 代码: config.DisableGlogInfo(); 现象: 增加了config.DisableGlogInfo(); paddleocr输出还是有一下日志 具体内容:

The given version [10] is not supported, only version 1 to 7 is supported in this build. 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

paddle-bot[bot] commented 1 year ago

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

zhwesky2010 commented 1 year ago

@zhaocanglong 你好,请问是跑的自己编写的OCR代码吗,使用的是哪个接口呢

zhaocanglong commented 1 year ago

@zhaocanglong 你好,请问是跑的自己编写的OCR代码吗,使用的是哪个接口呢 我采用的是官方的源码paddleocr2.6版本 。 接口:void ocr(std::vector &cv_all_img_names); 执行到这块会有日志:PPOCR ocr = PPOCR(); 我自己跟了一下代码,ocr_det.cpp和ocr_res.cpp的LoadModel方法中,我先调用了paddleinfer::Config config; config的DisableGlogInfo方法,但是执行到this->predictor = paddle_infer::CreatePredictor(config);就会有我问题提出来的日志输出

zhwesky2010 commented 1 year ago

@zhaocanglong https://www.paddlepaddle.org.cn/inference/v2.4/api_reference/python_api_doc/Config/OtherFunction.html#log

# 引用 paddle inference 预测库
import paddle.inference as paddle_infer

# 创建 config
config = paddle_infer.Config("./mobilenet_v1.pdmodel", "./mobilenet_v1.pdiparams")

# 去除 Paddle Inference 运行中的 LOG
config.disable_glog_info()

# 判断是否禁用 LOG - true
print("GLOG INFO is: {}".format(config.glog_info_disabled()))

可以通过 glog_info_disabled 判断下是否禁用glog生效了

zhaocanglong commented 1 year ago

@zhaocanglong https://www.paddlepaddle.org.cn/inference/v2.4/api_reference/python_api_doc/Config/OtherFunction.html#log

# 引用 paddle inference 预测库
import paddle.inference as paddle_infer

# 创建 config
config = paddle_infer.Config("./mobilenet_v1.pdmodel", "./mobilenet_v1.pdiparams")

# 去除 Paddle Inference 运行中的 LOG
config.disable_glog_info()

# 判断是否禁用 LOG - true
print("GLOG INFO is: {}".format(config.glog_info_disabled()))

可以通过 glog_info_disabled 判断下是否禁用glog生效了

返回值是1

zhaocanglong commented 1 year ago

@zhaocanglong https://www.paddlepaddle.org.cn/inference/v2.4/api_reference/python_api_doc/Config/OtherFunction.html#log

# 引用 paddle inference 预测库
import paddle.inference as paddle_infer

# 创建 config
config = paddle_infer.Config("./mobilenet_v1.pdmodel", "./mobilenet_v1.pdiparams")

# 去除 Paddle Inference 运行中的 LOG
config.disable_glog_info()

# 判断是否禁用 LOG - true
print("GLOG INFO is: {}".format(config.glog_info_disabled()))

可以通过 glog_info_disabled 判断下是否禁用glog生效了

返回值是1

1675319832292