Closed tommedema closed 2 years ago
I just found that when I disable C ("use_c": False
) this error does not occur. However, that defeats the purpose of my performance optimization with parallelization.
If it helps, I can create a minimal reproducible example using Google Collab (though I'm not sure if I can run child processes there). Please let me know and I really appreciate any help on this.
A minimal reproducible example would be helpful, yes. I do not seem to be able to repeat the error when using ipyparallel. And I can not immediately see where a non-writable view would be created.
You could also test the inputs (query and series) to the subsequence_alignment function with the following test to check if this is triggered by an operation before calling dtaidistance:
if query.flags.writeable is False:
assert('query is not writeable')
if series.flags.writeable is False:
assert('series is not writeable')
@wannesm brilliant! That taught me that somehow the input query is not writable. I was able to resolve the issue by wrapping it with: q = np.array(q)
. Even though it already was a numpy array (from np.take after to_numpy from pandas), which is weird, but at least it works now.
I'm trying to compute the DTW distances to various queries against many other time series. For each query I run
subsequence_search
with an array of time series (i.e. an array of arrays):Since I have many queries to compare against time series, this warrants a use case for parallelization, and so I setup a cluster with ipyparallel:
It works fine when running arbitrary python code:
However, as soon as I invoke
sa.kbest_matches_fast
inside one of the child processes, I get this exception:The entire log can be found here
I could ask in the ipyparallel repo too though the issue seems to only occur with dtaidistance when setting
use_c
to True and so I am wondering if you might have an idea what is going on here?