Error while importing network from Caffe

asked 2019-05-11 13:48:51 -0600

nimaaghli gravatar image

updated 2019-05-11 14:48:50 -0600

berak gravatar image

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.

edit retag flag offensive close merge delete

Comments

1

Start with OpenCV sample https://github.com/opencv/opencv/blob.... Faster takes two inputs (im_info the second one).

dkurt gravatar imagedkurt ( 2019-05-12 03:24:56 -0600 )edit

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.

Hesperia gravatar imageHesperia ( 2019-06-26 01:05:44 -0600 )edit