Skip to content

mclapply() hangs when keras-based neural networks are involved

1 message · Marius Hofert

#
Hi Simon,

thanks a lot for your answer. I also thought about writing some
functions to turn a trained NN into one that can be evaluated in R
more natively (I found several design decisions of 'keras' very
non-R-like).

Concerning your comment "you have to load the model into each
separately, nothing is shared and you have to restrict the resources",
I understand the former, but what do you mean by "restrict the
resources"? So the mclapply(1:5, function(b) aux(b), mc.cores = 2)
call in my minimal working example would need to be written such that
every aux() call loads the trained NN. But how could I restrict the
resources then? (Is there anything I need to pass to TF?).

Thanks & cheers,
M


On Fri, Aug 30, 2019 at 4:21 PM Simon Urbanek
<simon.urbanek at r-project.org> wrote: