itlab-vision / dl-benchmark

Deep Learning Inference benchmark. Supports OpenVINO™ toolkit, TensorFlow, TensorFlow Lite, ONNX Runtime, OpenCV DNN, MXNet, PyTorch, Apache TVM, ncnn, PaddlePaddle, etc.
http://hpc-education.unn.ru/dli
Apache License 2.0
27 stars 37 forks source link

Logging issues in RKNN launcher #485

Closed spartanezka closed 9 months ago

spartanezka commented 10 months ago

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