I am trying to process a Landsat8 OLI image using the Orfeo Toolbox Unsupervised KMeans Classification application.

I obtain the following error message:

Error when loading model 20140915_E1B1234_km.tif_model.txt

It works fine on Sentinel2 MSI images.

Any idea what could cause the application to fail on my Landsat image, although it works on the Sentinel image? Has anybody already encountered this issue?

  • I found a solution. I had NaN pixels in my image. After replacing them with no data values (using the ManageNoData application) the KMeans classification worked fine. So my conclusion is that the NaN pixels were causing the issue.
    – tvoirand
    May 23, 2018 at 8:57
  • it would be nice to add this as an answer, because comments are not well visible
    – radouxju
    Jul 18, 2018 at 7:14

2 Answers 2


There's an open issue about that on OTB's bug tracker, currently under investigation.

  • Yes I opened it actually, thanks for letting me know here.
    – tvoirand
    May 23, 2018 at 8:54

OTB's KMeansClassification app failed because my image contained nan pixels (here is the open issue on OTB's bug tracker). Converting nans to nodata using OTB's ManageNoData app should bypass the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.