Ask Your Question

Revision history [back]

Unspecified error (Can't create layer "data" of type "Input") in getLayerInstance

I've trained the GoogleNet model on custom datasets and trying to deploy in raspberry pi for image classification. Following code for image predictions: import cv2 net = cv2.dnn.readNetFromCaffe( 'deploy.prototxt', 'cyrrup_googlenet_iter_1110.caffemodel') frame = cv2.imread('frame.jpg', cv2.IMREAD_GRAYSCALE) image=cv2.resize(frame, (224, 224)) blob = cv2.dnn.blobFromImage(image,1, (224, 224), (104, 117, 123)) net.setInput(blob) detections = net.forward() print(detections)

The following error I'm getting.

OpenCV Error: Unspecified error (Can't create layer "data" of type "Input") in getLayerInstance, file /home/pi/opencv-3.3.0/modules/dnn/src/dnn.cpp, line 365 Traceback (most recent call last): File "image_detection.py", line 9, in detections = net.forward() cv2.error: /home/pi/opencv-3.3.0/modules/dnn/src/dnn.cpp:365: error: (-2) Can't create layer "data" of type "Input" in function getLayerInstance

Will anyone please help me to debug? If required more information I would like to discuss.

Thanks.

click to hide/show revision 2
None

updated 2017-12-28 03:36:29 -0600

berak gravatar image

Unspecified error (Can't create layer "data" of type "Input") in getLayerInstance

I've trained the GoogleNet model on custom datasets and trying to deploy in raspberry pi for image classification. Following code for image predictions: predictions:

import cv2
net = cv2.dnn.readNetFromCaffe(
'deploy.prototxt',
'cyrrup_googlenet_iter_1110.caffemodel')
frame = cv2.imread('frame.jpg', cv2.IMREAD_GRAYSCALE)
image=cv2.resize(frame, (224, 224))
blob = cv2.dnn.blobFromImage(image,1, (224, 224), (104, 117, 123))
net.setInput(blob)
detections = net.forward()
print(detections)

print(detections)

The following error I'm getting.

OpenCV Error: Unspecified error (Can't create layer "data" of type "Input") in getLayerInstance, file /home/pi/opencv-3.3.0/modules/dnn/src/dnn.cpp, line 365
Traceback (most recent call last):
File "image_detection.py", line 9, in
detections = net.forward()
cv2.error: /home/pi/opencv-3.3.0/modules/dnn/src/dnn.cpp:365: error: (-2) Can't create layer "data" of type "Input" in function getLayerInstance

getLayerInstance

Will anyone please help me to debug? If required more information I would like to discuss.

Thanks.