nupic.core-legacy
nupic.core-legacy copied to clipboard
SDRClassifier compute causes segmentation fault
The segmentation fault happens everytime the classifier compute() function writes more than 2 times to the same ClassifierResult instance.
For example, as in the unit test, adding 2 more computes to the same result will cause not only some assertion errors, but also:
c.fastCompute(0, input1, 4, 34.7, false, true, true, &result1); c.fastCompute(1, input1, 4, 34.7, false, true, true, &result1); c.fastCompute(2, input1, 4, 34.7, false, true, true, &result1);
*** Error in
./unit_tests': free(): invalid next size (fast): 0x00007f5e58003290 ***
Aborted (core dumped)`
If this is run outside gtest, then the error is just a simple "segmentation fault". The way I got around this is by destroying the result object and creating a new one before every compute(), however this defeats the whole purpose of having an associative array inside the result.
See full discussion on this issue on the discourse forum
Also, this happens with both the CLAClassifier and the SDRClassifier, because they write to ClassifierResult in the same way.
@natoromano Are you interested in working on this?
@rhyolight is this something that is currently being worked on?
@MedSolve I don't think anyone is working on this right now.
I found the course of my problem. I need to classify between 25.000 different classes and this results in high bucketIdx that in return makes everything crash.
-- My bucketIdx had a high offset so adjusting them to be only between 1 and 25.000 worked