Closed Aleoli2 closed 4 years ago
Hi,
Try with declaring the path of the file before constructor : ''' string filename = "path_to_folder/filename.xml"; NeuralNetwork neural_network(filename); ''' Let me know if this works for you, or what mistakes you come up with. If the issue remains, write me the information about you OS, software and compiler.
Hi, The same error it's happening. My OS is Debian 10 and I'm using QT. I compile OpenNN so I'm not using the .pro example. Using the QT debugger I have seeing that the program receives a segmentation fault in inputs_from_XML function. My compiler is the GNU Compiler version 8.3.0
And you try using .pro?
I'm going to check it on linux, because on windows it works without any problem.
I just checked it on Ubuntu 18.04, both using the QT creator .pro files and directly from cmake. Both ways work for me. I'm working on the dev branch, by the way. I am using this file loading it as @GuillermoArtelnics said.
I use the .pro and I was able to debug better the program. The error is produced in inputs_from_XML, in the line:
inputs_names[i] = input_element->GetText();
My inputs don't have names, so this function return 0. I think that the error happens because 0 isn't a string and inputs_names is vectorreturn 0;
to
return "";
and now it works.
The other issue is close, but the load function doesn't work to me. I have tried to use the constructor of Neural Network with the string of the filename (that calls to load function) and with tinyXML document (to call directly to from_XML) and none have worked. The terminal is closed without exception. If I put a wrong filename, it says that the document cannot be load, so the document is load correctly.