spmallick / learnopencv

Learn OpenCV : C++ and Python Examples
https://www.learnopencv.com/
20.69k stars 11.52k forks source link

dnn.cpp:1517: error: (-2:Unspecified error) Requested layer "class8_ab" not found in function 'getLayerData' #745

Open yunus-temurlenk opened 1 year ago

yunus-temurlenk commented 1 year ago

I was trying the c++ implementation. I got the error:

dnn.cpp:1517: error: (-2:Unspecified error) Requested layer "class8_ab" not found in function 'getLayerData'

I couldn't find the solution related to theproblem. Here is my environment which is resulted with this error:

Opencv: 4.3.0 Ubuntu 18.04

I am building the c++ code succesfully with the command:

g++ pkg-config --cflags --libs opencv4 colorizeImage.cpp -o colorizeImage.out -lopencv_core -lopencv_dnn -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -std=c++11

But after running the binary files it gives out the error.