Commit f82e3682 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

ENH: added a warning if the number of input of centroid is not the same as the number of classes

No related merge requests found
Showing with 4 additions and 0 deletions
+4 -0
......@@ -111,6 +111,10 @@ void LearningApplicationBase<TInputValue, TOutputValue>::TrainSharkKMeans(
shark::Normalizer<> normalizer(scaleRV, offsetRV);
centroidData = normalizer(centroidData);
}
if (centroidData.numberOfElements() != k)
otbAppLogWARNING( "The input centroid file will not be used because it contains " << centroidData.numberOfElements() <<
" points, which is different than from the requested number of class: " << k <<".");
classifier->SetCentroidsFromData( centroidData);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment