New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ilastk API: prediction gets stuck when not run in main process #2517
Comments
Thanks for providing the concise example - very easy to reproduce. The root cause seems to be ilastik/lazyflow creating worker threads once imported. These will not be available to the forked processes. Currently, there are a couple of workarounds, but I'm not sure if any of those are applicable in your case.
would any of those options work for you? |
Thanks for looking into this @k-dominik. For my issue option 3 is the way to go and it's working now :). |
I'd like to keep it open until we find a user friendly solution to this. I've to admit that I haven't thought about this before - so it's great that you brought it up! |
this enables external parallelization via multiprocessing fixes ilastik#2517
any import from experimental will reset the threadpool to 0 in order to have all other tests run normally, we reset it after each test module for the experimental tests further reference: see ilastik#2517
This issue has been mentioned on Image.sc Forum. There might be relevant details there: |
Describe the bug
Prediction with the ilastik API gets stuck when it's not run in the main process.
To Reproduce
Prediction in the main process and in a thread work, but prediction with the process pool does not terminate.
The project is available here. (But the same issue will most likely occur for any other project).
Why is this needed?
I want to use the ilastik api in a pytorch data loader, which uses multiprocessing (and this can't be changed...).
I assume that this issue might be hard to fix properly due to the whole lazyflow / greenlet stuff.
Maybe a workaround would be to expose the classifier and the feature functionality through the API somehow so that they can be used without running full ilastik inference, e.g.
get_classifier
(returns the RF) andget_features
(either returns a callable that computes the features given raw input or just the filter and sigma values that need to be interpreted by the user.)Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: