This commit is contained in:
ZaneYork 2022-01-01 23:36:03 +08:00
parent b779c8241f
commit d76cac1335
1 changed files with 2 additions and 2 deletions

View File

@ -166,12 +166,12 @@ def train(flags):
for j in range(flags.num_actors_thread): for j in range(flags.num_actors_thread):
for i in range(num_actors): for i in range(num_actors):
infer_queues.append({ infer_queues.append({
'input': ctx.Queue(), 'output': ctx.Queue() 'input': ctx.Queue(maxsize=100), 'output': ctx.Queue(maxsize=100)
}) })
infer_processes = [] infer_processes = []
for device in flags.infer_devices.split(','): for device in flags.infer_devices.split(','):
for i in range(flags.num_infer): for i in range(flags.num_infer if device != 'cpu' else 1):
infer = mp.Process( infer = mp.Process(
target=infer_logic, target=infer_logic,
args=(i, device, infer_queues, actor_model, flags, onnx_frame)) args=(i, device, infer_queues, actor_model, flags, onnx_frame))