julimueller / tl_ssd

47 stars 17 forks source link

error: (-215:Assertion failed) (numPriors * _numLocClasses * 4) == total(inputs[0], 1) #16

Closed ThanhHoang198 closed 3 years ago

ThanhHoang198 commented 4 years ago

I run you code using my own image. I dont change anything in your deploy.prototxt, THE INPUT SHAPE IS CORRECT but I encouter some error when i run net.forward()

[ERROR:0] global C:\projects\opencv-python\opencv\modules\dnn\src\dnn.cpp (3066) cv::dnn::dnn4_v20191202::Net::Impl::getLayerShapesRecursively OPENCV/DNN: [DetectionOutput]:(detection_out): getMemoryShapes() throws exception. inputs=4 outputs=0/0 [ERROR:0] global C:\projects\opencv-python\opencv\modules\dnn\src\dnn.cpp (3069) cv::dnn::dnn4_v20191202::Net::Impl::getLayerShapesRecursively input[0] = [ 1 110236 ] [ERROR:0] global C:\projects\opencv-python\opencv\modules\dnn\src\dnn.cpp (3069) cv::dnn::dnn4_v20191202::Net::Impl::getLayerShapesRecursively input[1] = [ 1 55118 ] [ERROR:0] global C:\projects\opencv-python\opencv\modules\dnn\src\dnn.cpp (3069) cv::dnn::dnn4_v20191202::Net::Impl::getLayerShapesRecursively input[2] = [ 1 2 220472 ] [ERROR:0] global C:\projects\opencv-python\opencv\modules\dnn\src\dnn.cpp (3069) cv::dnn::dnn4_v20191202::Net::Impl::getLayerShapesRecursively input[3] = [ 1 165354 ] error: (-215:Assertion failed) (numPriors _numLocClasses 4) == total(inputs[0], 1) in function 'cv::dnn::DetectionOutputLayerImpl::getMemoryShapes'

CAN YOU HELP ME, I JUST WANT TO REUSE YOU CODE TO TEST IMAGES SO I DONT CHANGE ANYTHING. WHERE AM I WRONG OR WHAT SHOULD I MODIFY THE CODE. SORRY FOR MY BAD ENGLISH, THANK YOU SO MUCH.

julimueller commented 4 years ago

Why do you use an opencv python module \opencv-python\opencv\modules\dnn\src\dnn.cpp? You should use caffe do load the network...

ThanhHoang198 commented 4 years ago

Why do you use an opencv python module \opencv-python\opencv\modules\dnn\src\dnn.cpp? You should use caffe do load the network...

It's hard to install caffe module on window so i try to convert it into a cv2.dnn.readfromcaffe module. Can you show me where is actual problem in the SSD pipeline so I can fix it by myself. Thanks !!!

julimueller commented 4 years ago

Seems like the problem is in your conversion pipeline and not in mine. I have no idea what you have done tbh.