Skip to content
Snippets Groups Projects
Commit f9ebc80d authored by Pavel KORSHUNOV's avatar Pavel KORSHUNOV
Browse files

removed decref of X in training

parent cb4a5899
No related branches found
No related tags found
1 merge request!3Fix segmentation fault when SVM is trained in sequenece. Fixes issue #9
Pipeline #
...@@ -596,8 +596,8 @@ static PyObject* PyBobLearnLibsvmTrainer_train ...@@ -596,8 +596,8 @@ static PyObject* PyBobLearnLibsvmTrainer_train
&PyBlitzArray_OutputConverter, &divide &PyBlitzArray_OutputConverter, &divide
)) return 0; )) return 0;
// do not decref X, otherwise it will be deleted by Python
//protects acquired resources through this scope //protects acquired resources through this scope
auto X_ = make_safe(X);
auto subtract_ = make_xsafe(subtract); auto subtract_ = make_xsafe(subtract);
auto divide_ = make_xsafe(divide); auto divide_ = make_xsafe(divide);
...@@ -676,7 +676,7 @@ static PyObject* PyBobLearnLibsvmTrainer_train ...@@ -676,7 +676,7 @@ static PyObject* PyBobLearnLibsvmTrainer_train
else machine = self->cxx->train(Xseq); else machine = self->cxx->train(Xseq);
// Note: This is not a solution. I just want to see if it will work in all CI's // Note: This is not a solution. I just want to see if it will work in all CI's
PyObject* iterator2 = PyObject_GetIter(X); //PyObject* iterator2 = PyObject_GetIter(X);
return PyBobLearnLibsvmMachine_NewFromMachine(machine); return PyBobLearnLibsvmMachine_NewFromMachine(machine);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment