Skip to content

TrainImagesClassifier raise an error if no validation is requested (-sample.vtr 0)

Description

In the TrainImagesClassifier application, an error is raised if no validation is requested (no io.valid input and sample.vtr 0) Gives: 2018-09-25 13:11:28 (FATAL): itk::ERROR: Failed to open GDALDataset file bayes.pl.model_samplesValid_1.shp :

Steps to reproduce

Run a training on any dataset using no validation dataset and the option sample.vtr set to 0.

Configuration information

Not relevant (happens systematically on all tested builds).

POSSIBLE WORKAROUND adding the following line:

fileNames.sampleValidOutputs.clear();

just after line 132 of file /Modules/Applications/AppClassification/otbTrainImagesClassifier.cxx

seems to fix the issue on my side.