提交 df79294c 编写于 作者: D dyning

add parameter enable_mkldnn

...@@ -64,6 +64,7 @@ def parse_args(): ...@@ -64,6 +64,7 @@ def parse_args():
type=str, type=str,
default="./ppocr/utils/ppocr_keys_v1.txt") default="./ppocr/utils/ppocr_keys_v1.txt")
parser.add_argument("--use_space_char", type=bool, default=True) parser.add_argument("--use_space_char", type=bool, default=True)
parser.add_argument("--enable_mkldnn", type=bool, default=False)
return parser.parse_args() return parser.parse_args()
...@@ -91,8 +92,10 @@ def create_predictor(args, mode): ...@@ -91,8 +92,10 @@ def create_predictor(args, mode):
config.enable_use_gpu(args.gpu_mem, 0) config.enable_use_gpu(args.gpu_mem, 0)
else: else:
config.disable_gpu() config.disable_gpu()
# config.enable_mkldnn() config.set_cpu_math_library_num_threads(6)
config.set_cpu_math_library_num_threads(4) if args.enable_mkldnn:
config.enable_mkldnn()
#config.enable_memory_optim() #config.enable_memory_optim()
config.disable_glog_info() config.disable_glog_info()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册