TrainImagesClassifier: ERROR

Hello,

I am trying to use OTB to run a image classification, but the algorithm fails at:

(FATAL) TrainImagesClassifier: itk::ERROR: StatisticsXMLFileReader(000001CBDFD81DA0): is a wrong Extension FileName : Expected .xml

here’s the full log:

Versão do QGIS: 3.10.1-A Coruña
Código de revisão do QGIS: ef24c526da
Versão do Qt: 5.11.2
Versão do GDAL: 3.0.2
Versão do GEOS: 3.8.0-CAPI-1.13.1
Versão do PROJ: Rel. 6.2.1, November 1st, 2019
Algoritmo de processamento…
Algoritmo ‘TrainImagesClassifier’ iniciando…
Entrada de parâmetros:
{ ‘io.il’ : [‘G:/Oceanauta/001_Projetos_Orçamentos/004_2019/002_Projetos_2019/Aguas de sauipe/ortofoto/Aguas-Sauipe_transparent_mosaic_group1.tif’], ‘io.vd’ : [‘G:/Oceanauta/001_Projetos_Orçamentos/004_2019/002_Projetos_2019/Aguas de sauipe/ortofoto/training_set.shp’], ‘io.valid’ : ‘’, ‘io.imstat’ : ‘C:\Users\pedro\OneDrive\Área de Trabalho\stats.xml’, ‘io.out’ : ‘C:/Users/pedro/OneDrive/Área de Trabalho/output.model’, ‘io.confmatout’ : ‘C:/Users/pedro/OneDrive/Área de Trabalho/confusion.csv’, ‘cleanup’ : True, ‘sample.mt’ : 1000, ‘sample.mv’ : 1000, ‘sample.bm’ : 1, ‘sample.vtr’ : 0.5, ‘sample.vfn’ : ‘LABEL’, ‘elev.dem’ : ‘’, ‘elev.geoid’ : ‘’, ‘elev.default’ : 0, ‘classifier’ : ‘libsvm’, ‘classifier.libsvm.k’ : ‘rbf’, ‘classifier.libsvm.m’ : ‘csvc’, ‘classifier.libsvm.c’ : 1, ‘classifier.libsvm.nu’ : 0.5, ‘classifier.libsvm.opt’ : False, ‘classifier.libsvm.prob’ : False, ‘classifier.sharkkm.centroids.in’ : ‘random’, ‘classifier.sharkkm.centroids.stats’ : ‘’, ‘classifier.sharkkm.centroids.out’ : ‘C:/Users/pedro/OneDrive/Área de Trabalho/centroids.txt’, ‘rand’ : 0 }
WARNING: Parameter -classifier.sharkkm.centroids.in will be ignored because -classifier is libsvm.
WARNING: Parameter -classifier.sharkkm.centroids.out will be ignored because -classifier is libsvm.
2020-01-27 20:04:52 (INFO) TrainImagesClassifier: Default RAM limit for OTB is 256 MB
2020-01-27 20:04:52 (INFO) TrainImagesClassifier: GDAL maximum cache size is 1628 MB
2020-01-27 20:04:52 (INFO) TrainImagesClassifier: OTB will use at most 12 threads
2020-01-27 20:04:52 (INFO) TrainImagesClassifier: Polygon analysis…
2020-01-27 20:04:52 (INFO) TrainImagesClassifier: Elevation management: setting default height above ellipsoid to 0 meters
2020-01-27 20:04:52 (INFO): Estimated memory for full processing: 188097MB (avail.: 256 MB), optimal image partitioning: 735 blocks
2020-01-27 20:04:52 (INFO): Estimation will be performed in 735 blocks of 72389x116 pixels
Analyze polygons…: 100% [] (2s)
2020-01-27 20:04:54 (INFO) TrainImagesClassifier: Sampling rates…
2020-01-27 20:04:54 (INFO) TrainImagesClassifier: Sampling strategy : fit the number of samples based on the smallest class
2020-01-27 20:04:54 (INFO) TrainImagesClassifier: Sampling rates for image 1 : className requiredSamples totalSamples rate
10 29074 418745 0.0694313
20 29074 763391 0.0380853
30 29074 56101 0.518244
40 29074 29074 1
50 29074 114194 0.254602
60 29074 481561 0.0603745
2020-01-27 20:04:54 (INFO) TrainImagesClassifier: Sample selection…
2020-01-27 20:04:54 (INFO) TrainImagesClassifier: Elevation management: setting default height above ellipsoid to 0 meters
2020-01-27 20:04:54 (INFO) TrainImagesClassifier: Sampling strategy : set number of samples for each class
2020-01-27 20:04:54 (INFO) TrainImagesClassifier: Sampling rates : className requiredSamples totalSamples rate
10 29074 418745 0.0694313
20 29074 763391 0.0380853
30 29074 56101 0.518244
40 29074 29074 1
50 29074 114194 0.254602
60 29074 481561 0.0603745
2020-01-27 20:04:54 (INFO): Estimated memory for full processing: 188097MB (avail.: 256 MB), optimal image partitioning: 735 blocks
2020-01-27 20:04:54 (INFO): Estimation will be performed in 750 blocks of 2896x2896 pixels
Selecting positions with periodic sampler…: 100% [
] (6s)
2020-01-27 20:05:00 (INFO) TrainImagesClassifier: Sample extraction…
2020-01-27 20:05:05 (INFO): Estimated memory for full processing: 282145MB (avail.: 256 MB), optimal image partitioning: 1103 blocks
2020-01-27 20:05:05 (INFO): Estimation will be performed in 1092 blocks of 72389x78 pixels
Extracting sample values…: 100% [] (6m 40s)
2020-01-27 20:11:46 (INFO): Estimated memory for full processing: 188097MB (avail.: 256 MB), optimal image partitioning: 735 blocks
2020-01-27 20:11:46 (INFO): Estimation will be performed in 750 blocks of 2896x2896 pixels
Split samples between training and validation…: 100% [
] (47s)
2020-01-27 20:12:34 (INFO) TrainImagesClassifier: Model training…
2020-01-27 20:12:34 (FATAL) TrainImagesClassifier: itk::ERROR: StatisticsXMLFileReader(000001CBDFD81DA0): is a wrong Extension FileName : Expected .xml
Tarefa executada em 464.62 segundos
Resultados:
{‘classifier.sharkkm.centroids.out’: 'C:/Users/pedro/OneDrive/Área de ’
‘Trabalho/centroids.txt’,
‘io.confmatout’: ‘C:/Users/pedro/OneDrive/Área de Trabalho/confusion.csv’,
‘io.out’: ‘C:/Users/pedro/OneDrive/Área de Trabalho/output.model’}

Hi Pedro,
It looks like the application can not read the stats.xml.
Maybe its related to the path of the file: can you retry in avoiding special characters and spaces in paths ? (“Área de Trabalho”–>“area_de_trabalho”)