itlab-vision / dl-benchmark

Deep Learning Inference benchmark. Supports OpenVINO™ toolkit, Caffe, TensorFlow, TensorFlow Lite, ONNX Runtime, OpenCV DNN, MXNet, PyTorch, Apache TVM, ncnn, etc.

Home Page:http://hpc-education.unn.ru/dli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logging issues in RKNN launcher

spartanezka opened this issue · comments

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);
    }