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
Threads are restarted over and over in tsfresh.extract_features if using multiprocessing #364
Comments
I just encountered this problem unrelated to tsfresh. So most likely this is not a tsfresh problem. Sorry for this! |
Did you find what was causing this issues? |
Hard to judge for us what causes this problem. Maybe @jscheithe can clarify how he fixed the issue . just a guess, did you try to start the feature extraction inside a pool worker? |
Yes i did! Sorry I didn't update .. This is the same as #185. There I wrote:
Also, even with the guard, the problem occurs when I start the script from an IPython console. On my machine, I actually have to start all scripts that involve multiprocessing from command line ... |
I am getting the same error, and it appears to be fixed with the |
This should only happen if your module contains direct calls to a function that uses multiprocessing (or imports a module that does). If so, you can consider rewriting something like this:
to something like this:
I don't exactly understand why, but for me it also helped to
in the script I was running. I'm not sure this is correct, so maybe someone who understands this better can be of more help. |
Unfortunately, this is a windows specific issue within the multiprocessing library, see #185 From what I understand, there is nothing what we can do inside the tsfresh library to catch this |
However, I think it is important to mention this in the documentation and provide some workaround(s). This can be a really frustrating one, especially if you're new to multiprocessing (on windows). |
We touch this topic in the faq http://tsfresh.readthedocs.io/en/latest/text/faq.html Where would you expect this information as a user? |
E.g. for So I think there are two options:
I think I'd prefer the second one. |
Thanks for the responses, I do see that the FAQ does mention the issue now, and I supposes that this is where I would mention the problem as well. I think it is worth considering @jscheithe 's suggestions, or perhaps in the FAQ mention the problem explicitly as a Windows problem, as it may not be obvious to novice users such as myself that we are using any multiprocessing features with tsfresh. |
Hello guys, I am a novice using tsfresh. Nonetheless I got the same problem as described before, and effectively I can resolve it with if name == "main": . For my use case I want to call a method that based on dataframe input can extract features and then return the dataframe with extracted features. I've tried the following, where in .py file I put the if name == "main": with all the imports and then a function I want to use. But in this case I cannot call the method "AttributeError: module 'feature_extraction.FirstTest' has no attribute 'my_extraction'"
|
Hi @tccf1109, Cheers,
|
Hi there,
first of all, thanks for this package, I'm using it very happily!
Since yesterday, I can't run
tsfresh.extract_features
andtsfresh.select_features
withn_jobs
> 1:When using IPython, the command line status bar stays at 0% forever. When I look in the Task Manager I see, that the processes are started, run for about 1 second, then die and are restarted over and over.
When I execute the script with python from the command line I get a
RuntimeError
as pasted below.The
DataFrame
I'm passing looks like this:I'm calling
tsfresh.extract_features(timeseries, column_id='trial_id', n_jobs=2)
and each sub-frame with the sametrial_id
has the same shape:[57 rows x 25 columns]
I wish I knew what caused the error, this used to work until yesterday on my machine (Windows 7 x64).
Also, other scripts using the package
multiprocessing
work fine.I am glad about any help. Thanks!
The text was updated successfully, but these errors were encountered: