Chi-Fang Hsieh
Chi-Fang Hsieh

Reputation: 235

opencv 3.1 dnn (caffe) module model import fail

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

Upvotes: 0

Views: 4912

Answers (2)

Anupam Sobti
Anupam Sobti

Reputation: 56

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.

Upvotes: 0

S421
S421

Reputation: 21

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

Upvotes: 1

Related Questions