From: Francois Fleuret Date: Fri, 16 Jun 2017 11:02:24 +0000 (+0200) Subject: Weird interaction between cuda and unrelated-with-cuda multiprocessing parts. Current... X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=c80fb2d538e0ccacb2523b762888db5ddada2a6e;p=pysvrt.git Weird interaction between cuda and unrelated-with-cuda multiprocessing parts. Currently removed the latter. --- diff --git a/vignette_set.py b/vignette_set.py index 19a6f33..0b6de7e 100755 --- a/vignette_set.py +++ b/vignette_set.py @@ -22,7 +22,7 @@ import torch from math import sqrt -from torch.multiprocessing import Pool, cpu_count +from torch import multiprocessing from torch import Tensor from torch.autograd import Variable @@ -53,11 +53,14 @@ class VignetteSet: for b in range(0, self.nb_batches): mp_args.append( [ problem_number, batch_size, seeds[b] ]) - # self.data = [] - # for b in range(0, self.nb_batches): - # self.data.append(generate_one_batch(mp_args[b])) + self.data = [] + for b in range(0, self.nb_batches): + self.data.append(generate_one_batch(mp_args[b])) + + # Weird thing going on with the multi-processing, waiting for more info - self.data = Pool(cpu_count()).map(generate_one_batch, mp_args) + # pool = multiprocessing.Pool(multiprocessing.cpu_count()) + # self.data = pool.map(generate_one_batch, mp_args) acc = 0.0 acc_sq = 0.0