Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV Error: Assertion failed ((!varTypesSet && vtypes[i] == rowtypes[i]) ...)& OpenCV Error: Assertion failed (sum > 0)

Hi Everyone

I am using https://github.com/opencv/opencv/blob/master/samples/cpp/tree_engine.cpp

and there is a little part of my data :

normal,0,31,29,78,1,0,0,0,4

normal,0,31,29,82,1,0,0,0,2

anomaly,2,254,0,0,1,0,0,0,0

anomaly,1,254,252,45,1,0.048129,1,1,6

normal,0,31,29,82,1,0,0,0,2

anomaly,1,254,252,45,1,0.046134,0,0,6

anomaly,1,254,252,45,1,0.044321,1,1,6

normal,0,31,29,82,1,0,0,0,2

but when I trying to use " -ts ord "to train ,it happened:

OpenCV Error: Assertion failed ((!varTypesSet && vtypes[i] == rowtypes[i]) || (varTypesSet && (vtypes[i] == rowtypes[i] || rowtypes[i] == VAR_ORDERED))) in cv::ml::TrainDataImpl::loadCSV, file C:\builds\master_PackSlave-win64-vc12-shared\opencv\modules\ml\src\data.cpp, line 593

and then I tried " -ts cat " ,it happened:

OpenCV Error: Assertion failed (sum > 0) in cv::ml::DTreesImpl::findSplitCatClass, file C:\builds\master_PackSlave-win64-vc12-shared\opencv\modules\ml\src\tree.cpp, line 880

I have read the document for opencv ,but still have no idea what the type_spec is.

Waiting for your answer , thanks !

click to hide/show revision 2
retagged

updated 2017-09-01 01:05:02 -0600

berak gravatar image

OpenCV Error: Assertion failed ((!varTypesSet && vtypes[i] == rowtypes[i]) ...)& OpenCV Error: Assertion failed (sum > 0)

Hi Everyone

I am using https://github.com/opencv/opencv/blob/master/samples/cpp/tree_engine.cpp

and there is a little part of my data :

normal,0,31,29,78,1,0,0,0,4

normal,0,31,29,82,1,0,0,0,2

anomaly,2,254,0,0,1,0,0,0,0

anomaly,1,254,252,45,1,0.048129,1,1,6

normal,0,31,29,82,1,0,0,0,2

anomaly,1,254,252,45,1,0.046134,0,0,6

anomaly,1,254,252,45,1,0.044321,1,1,6

normal,0,31,29,82,1,0,0,0,2

but when I trying to use " -ts ord "to train ,it happened:

OpenCV Error: Assertion failed ((!varTypesSet && vtypes[i] == rowtypes[i]) || (varTypesSet && (vtypes[i] == rowtypes[i] || rowtypes[i] == VAR_ORDERED))) in cv::ml::TrainDataImpl::loadCSV, file C:\builds\master_PackSlave-win64-vc12-shared\opencv\modules\ml\src\data.cpp, line 593

and then I tried " -ts cat " ,it happened:

OpenCV Error: Assertion failed (sum > 0) in cv::ml::DTreesImpl::findSplitCatClass, file C:\builds\master_PackSlave-win64-vc12-shared\opencv\modules\ml\src\tree.cpp, line 880

I have read the document for opencv ,but still have no idea what the type_spec is.

Waiting for your answer , thanks !