Open valentas-kurauskas opened 5 years ago
You can't use multithreading with R. See the docs for the R version of fit_generator
(https://www.rdocumentation.org/packages/keras/versions/2.2.4.1/topics/fit_generator). You can specify more than 1 worker, but the docs note that this is only for pure Python generator functions.
My generator MySequenceClass
is defined in python.
I understand that, but the interop will still end up having some R code called on a background thread.
On Tue, May 14, 2019 at 12:22 PM Valentas notifications@github.com wrote:
My generator MySequenceClass is defined in python.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rstudio/reticulate/issues/502?email_source=notifications&email_token=AAAZPRYPMNVVKYT5FUTFB6TPVLRLXA5CNFSM4HM3QQTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVMAR7Y#issuecomment-492308735, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAZPRZ4VHVFGQ4SWB7FU2DPVLRLXANCNFSM4HM3QQTA .
Trying to run a custom generator function with multithreading on Ubuntu 18.04 with a simple keras (version 2.2.4) model and reticulate (version 1.10), I get random
Error: C stack usage 459557818812 is too close to the limit
errors and some threads crash.A similar closed issue #288 says it was a bug in OP's code. I am not so sure:
ulimit -s unlimited
and run via reticulatekeras
package withuse_multithreading=TRUE
.459557818812
are way above my available RAM, and they look more like a bug in R's stack calculation when using multithreading?(I am sorry, but I do not have time at the moment to provide a complete self-contained example.)