Another cv::net.forward() problem

asked 2018-05-11 11:14:26 -0500

Banquin gravatar image

Hi everyone, I am trying to implement a object detector in ROS via OpenCV, However, in the step of forward(), I get always a mistake. The important parts of my code are:

cv::dnn::Net net;
    std::string path= ros::package::getPath("opencv_versuch_ros_tool");
    std::string path1=path+"/src/feed_network/opt_graph.pb";
    std::string path2=path+"/src/feed_network/graph.pbtxt";
    std::string pathImage=path+"/src/feed_network/audi.jpeg";
    cv::Mat image=cv::imread(pathImage);
    cv::Mat blob;
    cv::Mat outs=net.forward();

And when I execute it, I got:

OpenCV Error: Bad argument (PriorBox layer parameter does not contain min_size parameter.) in getParameter, file /builds/mrt-gbp/opencv/opencv/modules/dnn/src/layers/prior_box_layer.cpp, line 87
terminate called after throwing an instance of 'cv::Exception'
  what():  /builds/mrt-gbp/opencv/opencv/modules/dnn/src/layers/prior_box_layer.cpp:87: error: (-5) PriorBox layer parameter does not contain min_size parameter. in function getParameter


I dont know if its a ROS problem, or from the network. However, I already used this network in a Python OpenCV program, and it worked, so I wouldnt say that's the problem.

I also already ran the like:

python --input frozen_inference_graph.pb --output
 opt_graph.pb --input_names image_tensor --output_names "num_detections,detection_scores,detection_boxes,detection_classes" --placeholder_type_enum 4 --frozen_graph

If someone know what is the problem, would be great, thanks!

edit retag flag offensive close merge delete