Ask Your Question
0

dnn tensorflow faster_rcnn_resnet50_coco model error when predict[SOLVED]

asked 2019-06-28 03:26:15 -0600

NickKao gravatar image

updated 2019-07-03 21:28:34 -0600

supra56 gravatar image

Following the page https://github.com/opencv/opencv/wiki... My step is :

  1. train model done.
  2. run export_inference_graph.py to got frozen_inference_graph.pb
  3. test to load frozen_inference_graph.pb and predict by tensorflow then got image like this!(make sure pb is ok!)image description
  4. run tf_text_graph_faster_rcnn.py to gen graph.pbtxt
  5. run opencv dnn to load model(done) then to predict a image and the error come out. [org.opencv.core.CvException: cv::Exception: OpenCV(4.1.0) C:\opencv\opencv4.1.0\sources\modules\dnn\src\layers\detection_output_layer.cpp:706: error: (-215:Assertion failed) prior_height > 0 in function 'cv::dnn::DetectionOutputLayerImpl::DecodeBBox' ]
  6. After that to try the Troubleshooting's methods about optimize_for_inference.py or graph_transforms got same error。

Who can have a similar experience, can guide me, thank you (Once completed ssd_mobilenet_v2_coco by same way)

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2019-07-03 04:19:50 -0600

NickKao gravatar image

I solved it.

Try to download the latest opencv version(bigger then 4.1.0) and compile it yourself. This problem no longer occurs, it is already possible to load dnn normally and perform object detection normally.

So I think it is a bug in DetectionOutputLayerImpl::DecodeBBox. Because the check of the new source code prior_height > 0 has disappeared.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-06-28 03:26:15 -0600

Seen: 367 times

Last updated: Jul 03 '19