ImageClassifier : -215 Error: Assertion failed... What are the reasons and how to fix it?

Hello all,
I am using the last version of OTB and I have the following error message
ImageClassifier : Caught std::exception during application execution: OpenCV(4.3.0) C:\build\master_winpack-build-win64-vc15\opencv\modules\core\src\persistence.cpp:1477: error: (-215:Assertion failed) ofs == fs_data_blksz[blockIdx] in function ‘cv::FileStorage::Impl::normalizeNodeOfs’.in the title with one of my models.
I am under windows 10, and I have 3 models, two of them were applyed without problem, the last one produce the (Error -215 : assertion failed)

I Couldn’t identify the reason.
Looking about -215 OpenCV error, it’s seems to be a size limitation of OpenCv, but one of the tow other models is bigger than the failed one, so I really don’t understand how it’s can run with on or more and failed with another and seems to me (as a simple user) totally arbitrary functionning.
Thank you for your answers.

Hello Naf27,

Thank you for your message.
Could you send us the commands you launch to obtain your models ?
I suppose you used the same training method for all the three models.
Are you sure the inputs are consistent with those of the training step ?

Thanks in advance for these informations


Hello Yannick,
sorry for the delay to answer.
The three models are produced with the same tool and following the same work flow.
I think that i have identify the problem wich is related on the OpenCV version used in OTB 7.
So to solve my problem temporarly, I had tested two methods, both function but I am not sur that’s good or perenne options
1st solution: Replace The OpenCV (4.1) used by OTB by the OpenCV 3.4 version
2nd solution : launch the OTB 6.1 version for the classification step.

I think the problem here is related to an OpenCV issue which unfortunately seems to have stalled.