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

OpenCV DNN throws exception with Mask RCNN(Resnet 50) model #14548

Closed
qianyunw opened this issue May 14, 2019 · 0 comments
Closed

OpenCV DNN throws exception with Mask RCNN(Resnet 50) model #14548

qianyunw opened this issue May 14, 2019 · 0 comments

Comments

@qianyunw
Copy link

-->

System information (version)
  • OpenCV => 4.0.0
  • Operating System / Platform => Ubuntu 16.04 64 Bit
  • Compiler => gcc (5.4)
  • Cuda 9.0
  • cudnn 7
Detailed description

I trained a Mask RCNN model(with Resnet50 backbone) by using a Tensorflow object detection API. I try to test the model with a C++ (OpenCV DNN) application and a c++ file(mask_rcnn.cpp)(https://github.com/spmallick/learnopencv/tree/master/Mask-RCNN), but the getConstBlob always drop this exception

~/mask-rcnn-cv$ ./mask_rcnn.out --image='/home/wangqianyun/mask-rcnn-cv/cars.jpg' ./mask_rcnn.outterminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.0.0) /home/wangqianyun/opencv/modules/dnn/src/tensorflow/tf_importer.cpp:535: error: (-2:Unspecified error) Input [FirstStageFeatureExtractor/resnet_v1_50/resnet_v1_50/block3/unit_1/bottleneck_v1/conv2/Conv2D/paddings] for node [FirstStageFeatureExtractor/resnet_v1_50/resnet_v1_50/block3/unit_1/bottleneck_v1/conv2/SpaceToBatchND] not found in function 'getConstBlob'

Steps to reproduce
  1. similiar to tf_text_graph_faster_rcnn.py - Assertion error #13237, modify a pipeline.config file:
    replace

height_stride: 8
weight_stride: 8
to
height_stride: 16
weight_stride: 16
```

  1. use tf_text_graph_mask_rcnn.py() to produce .pbtxt from .pb and .config

  2. compile and run

g++ -std=c++11 -ggdb mask_rcnn.cpp -o mask_rcnn.out pkg-config --cflags --libs /home/wangqianyun/opencv/build/unix-install/opencv4.pc
(cv) wangqianyun@wangqianyun-ThinkCentre-E73:~/mask-rcnn-cv$ ./mask_rcnn.out --image='/home/wangqianyun/mask-rcnn-cv/cars.jpg' ./mask_rcnn.out.cpp
//
```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant