Open DonkeyShot21 opened 5 years ago
I'm dealing with a similar problem, have you found a solution in the meantime?
I ended up using torch.multiprocessing
. I don't remember exactly what I did but you can find some info here https://github.com/pytorch/pytorch/issues/26344. Also if you want you can take a look at the implementation of the parallel_predict
function of the uis-rnn
https://github.com/google/uis-rnn/blob/master/uisrnn/uisrnn.py
Hi, thanks for the awesome tool!
I am trying to do multiprocessing in a class that uses Pytorch.
This is what I am doing:
I am using pathos to circumvent the problem with python's standard
multiprocessing
that cannot work with class methods (pickle
complains).Now, the code set up like that works, the problem is that I encounter another problem, that is related to CUDA and Pytorch. Basically the GPU goes Out Of Memory (OOM) because the threads keep growing instead of releasing their memory. Again, seems to be a well known problem that can be solved using
torch.multiprocessing
instead of standardmultiprocessing
.The question is: How can I use both
pathos
(solves class method problem) andtorch.multiprocessing
(solves OOM problem)?