Ask Your Question

Revision history [back]

dnn.forward() can't create layer

System information (version)

OpenCV => : 3.3.0 Operating System / Platform => :Windows 10 Compiler => : Python 3.6 Detailed description

When loading Caffe neural network model I get error:

error: C:\projects\opencv-python\opencv\modules\dnn\src\dnn.cpp:365: error: (-2) Can't create layer "data" of type "WindowData" in function cv::dnn::experimental_dnn_v1::LayerData::getLayerInstance

Model and prototxt files: http://vision.soic.indiana.edu/egohands_files/hand_classifier.caffemodel http://vision.soic.indiana.edu/egohands_files/hand_classifier.prototxt

Steps to reproduce

import cv2
net = cv2.dnn.readNetFromCaffe(
'hand_classifier.prototxt',
'hand_classifier.caffemodel')
frame = cv2.imread('frame.jpg', cv2.IMREAD_GRAYSCALE)
blob = cv2.dnn.blobFromImage(cv2.resize(frame, (300, 300)),0.007843, (300, 300), 127.5)
net.setInput(blob)
detections = net.forward()
print(detections)