Pytorch多处理程序挂起

时间:2019-02-28 04:28:26

标签: python multithreading multiprocessing pytorch

for conv_layer in self.conv_layers:
    test_mat = conv_layer(test_mat)
    self.conv_norm_layers.append(nn.BatchNorm2d(test_mat.shape[1]))

我的pytorch多处理在上述代码中挂起。非多重处理可以完美地工作。下面是启动多重处理的代码:

for idx in range(num_worker):
    work = mp.Process(
        target=run_experiment,
        args=(experiment,),
        kwargs=dict(...
        )
    )
    work.start()
    works.append(work)

for idx in range(num_worker):
    works[idx].join()

0 个答案:

没有答案