Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
6a885632
P
PaddleOCR
项目概览
PaddlePaddle
/
PaddleOCR
大约 1 年 前同步成功
通知
1528
Star
32962
Fork
6643
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
108
列表
看板
标记
里程碑
合并请求
7
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
108
Issue
108
列表
看板
标记
里程碑
合并请求
7
合并请求
7
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
6a885632
编写于
3月 21, 2022
作者:
Z
zhoujun
提交者:
GitHub
3月 22, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix log print twice error (#5743)
上级
50e461f8
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
5 addition
and
4 deletion
+5
-4
ppocr/utils/logging.py
ppocr/utils/logging.py
+2
-1
test_tipc/supplementary/config.py
test_tipc/supplementary/config.py
+1
-1
tools/infer_vqa_token_ser_re.py
tools/infer_vqa_token_ser_re.py
+1
-1
tools/program.py
tools/program.py
+1
-1
未找到文件。
ppocr/utils/logging.py
浏览文件 @
6a885632
...
@@ -26,7 +26,7 @@ logger_initialized = {}
...
@@ -26,7 +26,7 @@ logger_initialized = {}
@
functools
.
lru_cache
()
@
functools
.
lru_cache
()
def
get_logger
(
name
=
'
root
'
,
log_file
=
None
,
log_level
=
logging
.
DEBUG
):
def
get_logger
(
name
=
'
ppocr
'
,
log_file
=
None
,
log_level
=
logging
.
DEBUG
):
"""Initialize and get a logger by name.
"""Initialize and get a logger by name.
If the logger has not been initialized, this method will initialize the
If the logger has not been initialized, this method will initialize the
logger by adding one or two handlers, otherwise the initialized logger will
logger by adding one or two handlers, otherwise the initialized logger will
...
@@ -67,4 +67,5 @@ def get_logger(name='root', log_file=None, log_level=logging.DEBUG):
...
@@ -67,4 +67,5 @@ def get_logger(name='root', log_file=None, log_level=logging.DEBUG):
else
:
else
:
logger
.
setLevel
(
logging
.
ERROR
)
logger
.
setLevel
(
logging
.
ERROR
)
logger_initialized
[
name
]
=
True
logger_initialized
[
name
]
=
True
logger
.
propagate
=
False
return
logger
return
logger
test_tipc/supplementary/config.py
浏览文件 @
6a885632
...
@@ -122,7 +122,7 @@ def preprocess(is_train=False):
...
@@ -122,7 +122,7 @@ def preprocess(is_train=False):
log_file
=
'{}/train.log'
.
format
(
save_model_dir
)
log_file
=
'{}/train.log'
.
format
(
save_model_dir
)
else
:
else
:
log_file
=
None
log_file
=
None
logger
=
get_logger
(
name
=
'root'
,
log_file
=
log_file
)
logger
=
get_logger
(
log_file
=
log_file
)
# check if set use_gpu=True in paddlepaddle cpu version
# check if set use_gpu=True in paddlepaddle cpu version
use_gpu
=
config
[
'use_gpu'
]
use_gpu
=
config
[
'use_gpu'
]
...
...
tools/infer_vqa_token_ser_re.py
浏览文件 @
6a885632
...
@@ -151,7 +151,7 @@ def preprocess():
...
@@ -151,7 +151,7 @@ def preprocess():
ser_config
=
load_config
(
FLAGS
.
config_ser
)
ser_config
=
load_config
(
FLAGS
.
config_ser
)
ser_config
=
merge_config
(
ser_config
,
FLAGS
.
opt_ser
)
ser_config
=
merge_config
(
ser_config
,
FLAGS
.
opt_ser
)
logger
=
get_logger
(
name
=
'root'
)
logger
=
get_logger
()
# check if set use_gpu=True in paddlepaddle cpu version
# check if set use_gpu=True in paddlepaddle cpu version
use_gpu
=
config
[
'Global'
][
'use_gpu'
]
use_gpu
=
config
[
'Global'
][
'use_gpu'
]
...
...
tools/program.py
浏览文件 @
6a885632
...
@@ -525,7 +525,7 @@ def preprocess(is_train=False):
...
@@ -525,7 +525,7 @@ def preprocess(is_train=False):
log_file
=
'{}/train.log'
.
format
(
save_model_dir
)
log_file
=
'{}/train.log'
.
format
(
save_model_dir
)
else
:
else
:
log_file
=
None
log_file
=
None
logger
=
get_logger
(
name
=
'root'
,
log_file
=
log_file
)
logger
=
get_logger
(
log_file
=
log_file
)
# check if set use_gpu=True in paddlepaddle cpu version
# check if set use_gpu=True in paddlepaddle cpu version
use_gpu
=
config
[
'Global'
][
'use_gpu'
]
use_gpu
=
config
[
'Global'
][
'use_gpu'
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录