We need to log errors for Android, because uncaught exceptions cause segfault there.
I don't find a way to turn on exceptions catch feature properly on Android, though
documentation states it's possible.
void RKNNLauncher::read(const std::string& model_file, const std::string& weights_file) {
destroy_context(); // destroy previous context to make clean model load to measure loading time
std::ifstream f(model_file, std::ios::binary | std::ios::ate);
if (!f.is_open()) {
std::string err_msg = "Can't open " + model_file;
logger::err << err_msg << logger::endl;
throw std::runtime_error(err_msg);
}
We need to log errors for Android, because uncaught exceptions cause segfault there. I don't find a way to turn on exceptions catch feature properly on Android, though documentation states it's possible.