Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: cv::dnn::dnn4_v20211004::LayerData&) () from /usr/local/lib/libopencv_world.so.4.5 #22929

Open
karishmathumu opened this issue Dec 7, 2022 · 3 comments

Comments

@karishmathumu
Copy link

karishmathumu commented Dec 7, 2022

0x0000ffffee8cb194 in cv::dnn::dnn4_v20211004::Net::Impl::forwardLayer(cv::dnn::dnn4_v20211004::LayerData&) () from /usr/local/lib/libopencv_world.so.4.5

**

  • OpenCV => 4.5.4
  • Operating System / Platform => Linux : aarch64-gnu , Ubuntu 20.04
  • Compiler => Visual Studio 2019
  • DARKNET
  • CUDA
  • JETSON ORIN
  • **

I am trying to implement R-CNN Masking on my custom object detection model with yolov3 - DAKRNET and opencv 4.5.4 on Jetson Orin.

I have succeeded in the Object detection with CUDA backend support

Now in the masking implementation for the same, I followed this tutorial in cpp
https://github.com/spmallick/learnopencv/blob/master/Mask-RCNN/mask_rcnn.cpp

String textGraph = "./mask_rcnn_inception_v2_coco_2018_01_28.pbtxt";
String modelWeights = "./mask_rcnn_inception_v2_coco_2018_01_28/frozen_inference_graph.pb";

    // Load the network
    Net net = readNetFromTensorflow(modelWeights, textGraph);

    if (device == "cpu")
    {
        cout << "Using CPU device" << endl;
        net.setPreferableBackend(DNN_TARGET_CPU);
    }
    else if (device == "gpu")
    {
        cout << "Using GPU device" << endl;
        net.setPreferableBackend(DNN_BACKEND_CUDA);
        net.setPreferableTarget(DNN_TARGET_CUDA);
    }

I replaced the respective above lines of this code with the following lines

String modelConfig = "/home/.../darknet/cfg/yolo-obj-3classes.cfg";
String modelWts = "/home/.../darknet/yolo-obj_final_3classes.weights";

    // Load the network
Net net = readNetFromDarknet(modelConfig, modelWts);
net.setPreferableBackend(DNN_BACKEND_OPENCV);
net.setPreferableTarget(DNN_TARGET_CPU);

P.S: while the exact same lines worked prefectly good with the plain object detection

And my error when I run this on the Visual Studio 2019 is as follows:

0x0000ffffee8cb194 in cv::dnn::dnn4_v20211004::Net::Impl::forwardLayer(cv::dnn::dnn4_v20211004::LayerData&) () from /usr/local/lib/libopencv_world.so.4.5

Seeking for help and suggestions.

Kind regards,
Karishma

@krrishdholakia
Copy link

Are you using the same versions of CUDA and darknet as in the tutorial?

@karishmathumu
Copy link
Author

Yes, I did not find in the mentioned tutorial which CUDA version and darknet it uses.

But my combination of CUDA 11.4 and AlexeyAB - DARKNET for this tutorial's predecesser tutorial which is https://learnopencv.com/deep-learning-based-object-detection-using-yolov3-with-opencv-python-c/

and I used my custom-trained yolov3 model - a) weights and b) config file for the object detection.

So, continuing with those very same weights and config files in this tutorial for Instance segmentation.

@asmorkalov
Copy link
Contributor

@krrishdholakia Is it still relevant for OpenCV 4.8.0?

@asmorkalov asmorkalov added category: dnn and removed question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org labels Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants