This commit is contained in:
LDOUBLEV 2021-07-01 12:12:04 +08:00
parent b69f3c5a2b
commit f1ff1ca102
1 changed files with 1 additions and 1 deletions

View File

@ -141,7 +141,7 @@ def create_predictor(args, mode, logger):
max_batch_size=args.max_batch_size)
else:
config.disable_gpu()
cpu_threads = args.cpu_threads if hasattr(args, cpu_threads) else 10
cpu_threads = args.cpu_threads if hasattr(args, "cpu_threads") else 10
config.set_cpu_math_library_num_threads(cpu_threads)
if args.enable_mkldnn:
# cache 10 different shapes for mkldnn to avoid memory leak