Orfeo Toolbox Stats failure
I am trying to train some data with the latest version of Orfeo toolbox (8.0.1) and QGIS version 3.22.5-Białowieża. After computing the image stats as a .xml format file without any special characters in the file name and then using the image stats output in the image trainer, I keep receiving this error. I see that one other user had the same problem in the past and I have tried the fixes suggested (not to use special characters) but it didn’t work. I use windows 11 Pro. See console below.
Please advise.
Kind regards
QGIS version: 3.22.5-Białowieża
QGIS code revision: c2723178
Qt version: 5.15.2
Python version: 3.9.5
GDAL version: 3.4.1
GEOS version: 3.10.2-CAPI-1.16.0
PROJ version: Rel. 8.2.1, January 1st, 2022
PDAL version: 2.3.0 (git-version: 9f35b7)
Algorithm started at: 2022-05-06T11:43:35
Algorithm ‘TrainImagesClassifier’ starting…
Input parameters:
{ ‘io.il’ : [‘C:/Users/daveh/Desktop/ORFEO Test DELETE/Stats/CarlitzdorpAloes20210818.tif’], ‘io.vd’ : [‘C:/Users/daveh/Documents/Aloes.shp’], ‘io.valid’ : None, ‘io.imstat’ : ‘C:\Users\daveh\Desktop\ORFEO Test DELETE\Stats\ImageStats.xml’, ‘io.out’ : ‘C:/Users/daveh/Desktop/ORFEO Test DELETE/Stats/KNN_Model.xml’, ‘io.confmatout’ : ‘C:/Users/daveh/Desktop/ORFEO Test DELETE/Stats/OutputKNN.xml’, ‘cleanup’ : False, ‘sample.mt’ : 1000, ‘sample.mv’ : 1000, ‘sample.bm’ : 1, ‘sample.vtr’ : 0.8, ‘sample.vfn’ : ‘Label’, ‘elev.dem’ : ‘’, ‘elev.geoid’ : ‘’, ‘elev.default’ : 0, ‘classifier’ : ‘knn’, ‘classifier.knn.k’ : 32, ‘rand’ : 0 }
2022-05-06 11:43:35 (INFO) TrainImagesClassifier: Default RAM limit for OTB is 256 MB
2022-05-06 11:43:35 (INFO) TrainImagesClassifier: GDAL maximum cache size is 1608 MB
2022-05-06 11:43:35 (INFO) TrainImagesClassifier: OTB will use at most 16 threads
2022-05-06 11:43:35 (INFO): Loading metadata from official product
2022-05-06 11:43:35 (INFO) TrainImagesClassifier: Polygon analysis…
2022-05-06 11:43:35 (INFO) TrainImagesClassifier: Elevation management: setting default height above ellipsoid to 0 meters
2022-05-06 11:43:35 (INFO): Estimated memory for full processing: 6478MB (avail.: 256 MB), optimal image partitioning: 26 blocks
2022-05-06 11:43:35 (INFO): Estimation will be performed in 27 blocks of 12090x651 pixels
Analyze polygons…: 100% [**************************************************] (0s)
2022-05-06 11:43:35 (INFO) TrainImagesClassifier: Sampling rates…
2022-05-06 11:43:35 (INFO) TrainImagesClassifier: Sampling strategy : fit the number of samples based on the smallest class
2022-05-06 11:43:35 (INFO) TrainImagesClassifier: Sampling rates for image 1 : className requiredSamples totalSamples rate
1 32876 32876 1
2 32876 42145 0.780069
2022-05-06 11:43:35 (INFO) TrainImagesClassifier: Sample selection…
2022-05-06 11:43:35 (INFO) TrainImagesClassifier: Elevation management: setting default height above ellipsoid to 0 meters
2022-05-06 11:43:35 (INFO) TrainImagesClassifier: Sampling strategy : set number of samples for each class
2022-05-06 11:43:35 (INFO) TrainImagesClassifier: Sampling rates : className requiredSamples totalSamples rate
1 32876 32876 1
2 32876 42145 0.780069
2022-05-06 11:43:35 (INFO): Estimated memory for full processing: 6478MB (avail.: 256 MB), optimal image partitioning: 26 blocks
2022-05-06 11:43:35 (INFO): Estimation will be performed in 35 blocks of 2864x2864 pixels
Selecting positions with periodic sampler…: 100% [**************************************************] (0s)
2022-05-06 11:43:36 (INFO) TrainImagesClassifier: Sample extraction…
2022-05-06 11:43:37 (INFO): Estimated memory for full processing: 9717.08MB (avail.: 256 MB), optimal image partitioning: 38 blocks
2022-05-06 11:43:37 (INFO): Estimation will be performed in 39 blocks of 12090x451 pixels
Extracting sample values…: 100% [**************************************************] (7s)
2022-05-06 11:43:44 (INFO): Estimated memory for full processing: 6478MB (avail.: 256 MB), optimal image partitioning: 26 blocks
2022-05-06 11:43:44 (INFO): Estimation will be performed in 35 blocks of 2864x2864 pixels
Split samples between training and validation…: 100% [**************************************************] (2s)
2022-05-06 11:43:47 (INFO) TrainImagesClassifier: Model training…
2022-05-06 11:43:47 (FATAL) TrainImagesClassifier: itk::ERROR: StatisticsXMLFileReader(00000202CEA71380): is a wrong Extension FileName : Expected .xml
Execution completed in 11.94 seconds
Results:
{‘io.confmatout’: 'C:/Users/daveh/Desktop/ORFEO Test ’
‘DELETE/Stats/OutputKNN.xml’,
‘io.out’: ‘C:/Users/daveh/Desktop/ORFEO Test DELETE/Stats/KNN_Model.xml’}
Loading resulting layers
Algorithm ‘TrainImagesClassifier’ finished