未验证 提交 6b91f9c1 编写于 作者: W wopeizl 提交者: GitHub

fix the hang issue on windows with cuda10 test=develop (#3282)

* fix the gru/gnn hang issue on windows with cuda10 test=develop
上级 e7ed651c
......@@ -113,7 +113,10 @@ def train(train_reader,
exe = fluid.Executor(place)
exe.run(fluid.default_startup_program())
train_exe = fluid.ParallelExecutor(use_cuda=True, loss_name=avg_cost.name)
exec_strategy = fluid.ExecutionStrategy()
exec_strategy.num_threads = 1 if os.name == 'nt' else 0
train_exe = fluid.ParallelExecutor(
use_cuda=True, loss_name=avg_cost.name, exec_strategy=exec_strategy)
total_time = 0.0
fetch_list = [avg_cost.name]
......
......@@ -101,8 +101,10 @@ def train():
feed_list = [e.name for e in feed_datas]
if use_parallel:
exec_strategy = fluid.ExecutionStrategy()
exec_strategy.num_threads = 1 if os.name == 'nt' else 0
train_exe = fluid.ParallelExecutor(
use_cuda=use_cuda, loss_name=loss.name)
use_cuda=use_cuda, loss_name=loss.name, exec_strategy=exec_strategy)
else:
train_exe = exe
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册