[libprotobuf ERROR C:\opencv320\build\modules\dnn\3rdparty\protobuf\sources\prot
obuf-3.1.0\src\google\protobuf\text_format.cc:298] Error parsing text-format caf
fe.NetParameter: 817:14: Message type "caffe.LayerParameter" has no field named
"norm_param".
OpenCV Error: Unspecified error (FAILED: ReadProtoFromTextFile(param_file, param
). Failed to parse NetParameter file: C:\Users\REG-LPT-038\Documents\SSD Models\
V2\deploy.prototxt) in cv::dnn::ReadNetParamsFromTextFileOrDie, file C:\opencv32
0\opencv_contrib320\modules\dnn\src\caffe\caffe_io.cpp, line 1101
C:\opencv320\opencv_contrib320\modules\dnn\src\caffe\caffe_io.cpp:1101: error: (
-2) FAILED: ReadProtoFromTextFile(param_file, param). Failed to parse NetParamet
er file: C:\Users\REG-LPT-038\Documents\SSD Models\V2\deploy.prototxt in functio
n cv::dnn::ReadNetParamsFromTextFileOrDie
net.forward();OpenCV Error: Assertion failed ((bias && l->blobs.size() == 2) || (!bias && l->b
lobs.size() == 1)) in cv::dnn::initConvDeconvLayerFromCaffe, file C:\opencv320\o
pencv_contrib320\modules\dnn\src\caffe\layer_loaders.cpp, line 27
OpenCV Error: Assertion failed (The following error occured while making allocat
e() for layer "pool6_mbox_loc": (bias && l->blobs.size() == 2) || (!bias && l->b
lobs.size() == 1)) in cv::dnn::initConvDeconvLayerFromCaffe, file C:\opencv320\o
pencv_contrib320\modules\dnn\src\caffe\layer_loaders.cpp, line 27
Type of file: PNG
Size: 666KB
Dimensions: 1024x578
Bit depth: 24
After successfully compiling the OpenCV3.2 [SSD sample code],
SSD.exe -proto="C:\Users\REG-LPT-038\Docume
nts\SSD Models\V2\deploy.prototxt" -model="C:\Users\REG-LPT-038\Documents\
SSD Models\V2\VGG_VOC0712_SSD_300x300_iter_120000.caffemodel" -image="E:\vlc
snap-2016-11-07-10h08m20s920.png" -min_confidence="0.7"
SSD.exe -proto="C:\opencv320\opencv_contrib320\modules\dnn\samples\
VGG_VOC0712_SSD_300x300_iter_60000.prototxt" -model="C:\Users\REG-LPT-038\Docume
nts\SSD Models\V2\VGG_VOC0712_SSD_300x300_iter_120000.caffemodel" -image="E:\vlc
snap-2016-11-07-10h08m20s920.png" -min_confidence="0.7"
Any advice is greatly appreciated.
Thank you.
I have managed to come up with a solution by comparing the deploy.prototxt with the OpenCV3.2 prototxt and then apply the changes accordingly.
P.S. Thank you for the awesome work on the library!
I meet the same problem.Could you help me?how to change the prototxt.
Thank you.
I got it,too!
It is different name for the same param!
normalize_bbox_param==norm_param
Wow, thanks for integration!
I meet such problem ether, but how to change the prototxt in detail?
I am new to caffe and I felt excited when I knew OpenCV supports SSD nevertheless it doesn't work.
Hi, the library works actually. It's just that they seem to not support some of the parameters and uses different layer type names.
A quick check on www.diffchecker.com between the supplied prototxt example and any of the downloaded model from the SSD author will let you know what to change.
If my memory serves me well, you will have to change "Normalize" to "NormalizeBBox", norm_param to normalize_bbox_param, remove all step and offset, and also amend the detection_output_param in the last layer.
Good luck!
It works amazingly! Thank you so much!
Leaving the modified file here for anyone else facing this issue.
deploy.txt
You can rename this file to deploy.prototxt and use the following command:
./example_dnn_ssd_object_detection --image=./rgb_frame40.png --model=VGG_VOC0712_SSD_300x300_iter_120000.caffemodel --proto=deploy.prototxt --min_confidence=0.5
Most helpful comment
Hi, the library works actually. It's just that they seem to not support some of the parameters and uses different layer type names.
A quick check on www.diffchecker.com between the supplied prototxt example and any of the downloaded model from the SSD author will let you know what to change.
If my memory serves me well, you will have to change "Normalize" to "NormalizeBBox", norm_param to normalize_bbox_param, remove all step and offset, and also amend the detection_output_param in the last layer.
Good luck!