0
votes

environment:

OS: win 10

IDE: Visual Studio 2013

opencv: 3.1 master from https://github.com/Itseez/opencv

opencv_contrib: from https://github.com/Itseez/opencv_contrib

graphic card: nvidia GeForce 610M

CUDA: tool kit v7.5 & cudnn is install

what I have done:

  1. build the dll & lib by http://docs.opencv.org/3.1.0/de/d25/tutorial_dnn_build.html and success

  2. use the sample code (from http://docs.opencv.org/3.1.0/d5/de7/tutorial_dnn_googlenet.html)with the caffe model & prototxt (download in current folder) and build success

Question: once I run my code. it will fail during import caffe model file

please point me out what wrong, thanks a lot....

the error is bellow:


[libprotobuf ERROR D:\openCV_root\opencv_contrib\modules\dnn\3rdparty\protobuf\src\google\protobuf\text_format.cc:245] Error parsing text-format caffe.NetParameter: 6:15: Message type "caffe.LayerParameter" has no field named "input_param".

OpenCV Error: Unspecified error (FAILED: ReadProtoFromTextFile(param_file, param).Failed to parse NetParameter file: ./bvlc_googlenet.prototxt) in cv::dnn::ReadNetParamsFromTextFileOrDie, file D:\openCV_root\opencv_contrib\modules\dnn\src\caffe\caffe_io.cpp, line 1101

D:\openCV_root\opencv_contrib\modules\dnn\src\caffe\caffe_io.cpp:1101: error: (-2) FAILED: ReadProtoFromTextFile(param_file, param).Failed to parse NetParameter file: ./bvlc_googlenet.prototxt

in function cv::dnn::ReadNetParamsFromTextFileOrDie

enter image description here

2
I fine the root cause from " github.com/BVLC/caffe/issues/3846 " I should change to "old definition" after fix this, I will fail at " net.forward(); " the error msg is below: OpenCV Error: Assertion failed (input.dims() == 4 && (input.type() == CV_32F || input.type() == CV_64F)) in cv::dnn::ConvolutionLayerImpl::allocate, file D:\openCV_root\opencv_contrib\modules\dnn\src\layers\convolution_layer.cpp, line 89 - Chi-Fang Hsieh

2 Answers

1
votes

build opencv and opencv_contrib with the tag 3.1.0 works for opencv dnn

0
votes

The DNN importer doesn't support some constructs of the caffe prototxt file. Nevertheless, you can modify and use it.

Link to issue on github.
Link to modified prototxt.