Skip to content
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

Segmentation fault error when running python version #4

Open
neezi opened this issue Oct 8, 2019 · 10 comments
Open

Segmentation fault error when running python version #4

neezi opened this issue Oct 8, 2019 · 10 comments

Comments

@neezi
Copy link

neezi commented Oct 8, 2019

I've been getting segmentation faults whenever I try to run the python version. For smaller data sets it works fine. Here I'm using a data set of size 100x10000. As soon as I go to 200x10000 it gets hung up. The iteration that it breaks on changes from attempt to attempt. Sometimes it breaks on iteration 150. Sometimes on 174. Seems like a memory problem?

@chlubba
Copy link
Collaborator

chlubba commented Oct 8, 2019

Thanks for opening this issue. What Python version are you running on what system? I'll look into it in the next days.

@neezi
Copy link
Author

neezi commented Oct 8, 2019

Python 3.6 on Ubuntu 18.04.3 LTS. I placed an additional line took the absolute value of each vector and that seems to have removed the error.

@GerardBCN
Copy link

What worked for me was to inactivate the following feature:

CO_Embed2_Dist_tau_d_expfit_meandiff

I would expect depending on the dataset, some specific feature might be causing the segmentation fault.

@benfulcher
Copy link
Collaborator

@GerardBCN Do you have an example of a specific time series that causes a segmentation fault when running this CO_Embed2_Dist_tau_d_expfit_meandiff? If so, we can build in better handling of these cases. We had no issues with the >100k time series we tested this on, right, @chlubba ? So it would be interesting to see what sort of time-series structures cause the major issue.

@chlubba
Copy link
Collaborator

chlubba commented Feb 28, 2020

Yes, on our time series we did not get segmentation faults. @GerardBCN, as @benfulcher said it would be very helpful for us if you had an example of a time series where the error occurs. Thanks in advance!

@chanshing
Copy link

chanshing commented Jan 15, 2021

@chlubba @benfulcher There seems to be some memory leakage, which may explain the segmentation fault. Here's a simple example:

for _ in range(1000000):
    catch22_all(np.random.randn(1000))

Run the above and see how your memory steadily increases. I run this in IPython and even after I hit Ctrl+C to stop the loop, the accumulated memory was still there. It wasn't until I exited IPython that my memory went down back to normal.

@chanshing
Copy link

chanshing commented Jan 19, 2021

The above is not a far-fetched example: It is common to break a long timeseries into small windows and do feature extraction in each window -- in other words, a rolling window feature extraction. This is what I am doing and that's how I encountered this issue.

@chlubba
Copy link
Collaborator

chlubba commented Jan 19, 2021

Hi @chanshing, thanks for pointing to the issue of memory consumption. Which wrapper are you using (Python, Matlab, R)?

This issue here opened by @neezi is about a segmentation fault. So slightly different topic. But both are related to memory management, I agree.

@chanshing
Copy link

Hi @chlubba I'm using the Python wrapper. The full example above would be:

import numpy as np
from catch22 import catch22_all

for _ in range(1000000):
    catch22_all(np.random.randn(1000))

When running the above code long enough, I get the mentioned segmentation fault. That's why I suspect it has to do with the memory leakage.

@quesadagranja
Copy link

Hi @chlubba. I confirm there's a memory leak using the R wrapper. It can be checked with the following code:

library(catch22)

for(ii in 1:1E6) {
  catch22::catch22_all(rnorm(1000))
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants