Error while importing network from Caffe
Hello, I am trying to import a pre-trained network from Caffe. I receive following error
def FasterRCNN_VGG16(image): model_file = 'vgg16_faster_rcnn_iter_80000.caffemodel' proto_file = 'vgg16_faster_rcnn_iter_80000.prototxt' net = cv2.dnn.readNetFromCaffe(proto_file,model_file) blob = cv2.dnn.blobFromImage(cv2.resize(image,(224, 224)), 1.0, (224, 224), (104,177, 123)) net.setInput(blob) return net.forward()
File "/Users/nimaaghli/PycharmProjects/embraer/detectors/detector_dnn.py", line 23, in FasterRCNN_VGG16 return net.forward() cv2.error: OpenCV(4.1.0)
/Users/travis/build/skvark/opencv-python/opencv/modules/dnn/src/dnn.cpp:2297: error: (-215:Assertion failed) inp.total() in function 'allocateLayers'
link to the .prototxt https://github.com/playerkk/face-py-f...
I believe there is problem in my prototxt file but I can not figure out what.
Start with OpenCV sample https://github.com/opencv/opencv/blob.... Faster takes two inputs (im_info the second one).
Hey, brother, I got the same problem as you met. So, I wander that did you fix this problem ? I will appreciate it if you share your method about fixing this problem.