Skip to content

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

2 messages · Marius Hofert, Simon Urbanek

#
Hi Simon,

thanks a lot for helping.

That's a huge let-down... For training neural networks, this seems
understandable, but once trained, just to evaluate neural networks,
all applications are then restricted to serial computations... *sigh*.

Cheers,
M




On Fri, Aug 30, 2019 at 9:39 AM Simon Urbanek
<simon.urbanek at r-project.org> wrote:
#
Yep, I fully agree, I ran into the same problem, but even a trained model still uses TF to run the scoring so all TF limitations still apply. From some searching I saw the TF community is aware of the problem, but there is no solution.

Obviously, you can just start n processes, limit resources to each and use them for scoring. But, again, note that TF tries to use all resources so unless you use multiple models.

In principle you could save all the weights and use plain C code to score the model using those weights which would be safe, but likely a lot of duplicate work depending on the model. 

Cheers,
Simon