fann icon indicating copy to clipboard operation
fann copied to clipboard

fann_train_on_file does not set error on bad input training file data

Open jjYBdx4IL opened this issue 9 years ago • 5 comments

there is an error logged by the parsing function, but that function has no access to the nn struct containing the error. I'm trying to generate exceptions in fannj for fann error conditions and discovered that the user is not able to detect all errors programmatically, ie. without looking at console output or inconveniently redirecting error output.

jjYBdx4IL avatar Jun 16 '16 17:06 jjYBdx4IL

You don't specify which functions, but both structs fann and fann_train_data can be cast to a fann_error. See my other comment.

joelself avatar Jun 17 '16 00:06 joelself

fann_train_on_file() when called with badly formatted training data, for example. And fann_cascadetrain_on_file(). They both just return without giving any indication of an error it seems, when they bail after failing to read the input data.

jjYBdx4IL avatar Jun 17 '16 10:06 jjYBdx4IL

Do they just segfault? I don't have a machine to test on right now.

joelself avatar Jun 17 '16 18:06 joelself

no, they just return and the user (caller) has no chance to detect the error by any reasonable means.

jjYBdx4IL avatar Jun 17 '16 19:06 jjYBdx4IL

I think it makes sense in general to have some way how to identify error on ann when train data cannot be created. There is an error in error log as you know but it might not be always clear and reliable.

bukka avatar May 19 '18 10:05 bukka