Cv2 face recognition error

code
import cv2

model = ‘data/res10_300x300_ssd_iter_140000.caffemodel’
config = ‘data/deploy.prototxt’

cap = cv2.VideoCapture(0)

if not cap.isOpened():
print(‘Camera open failed!’)
exit()

net = cv2.dnn.readNet(model, config)

if net.empty():
print(‘Net open failed!’)
exit()

while True:
_, frame = cap.read()
if frame is None:
break

blob = cv2.dnn.blobFromImage(frame, 1, (300, 300), (104, 177, 123))
net.setInput(blob)
detect = net.forward()

detect = detect[0, 0, :, :]
(h, w) = frame.shape[:2]

for i in range(detect.shape[0]):
    confidence = detect[i, 2]
    if confidence < 0.5:
        break

    x1 = int(detect[i, 3] * w)
    y1 = int(detect[i, 4] * h)
    x2 = int(detect[i, 5] * w)
    y2 = int(detect[i, 6] * h)

    cv2.rectangle(frame, (x1, y1), (x2, y2), (0, 255, 0))

    label = 'Face: %4.3f' % confidence
    cv2.putText(frame, label, (x1, y1 - 1), cv2.FONT_HERSHEY_SIMPLEX, 0.8, (0, 255, 0), 1, cv2.LINE_AA)

cv2.imshow('frame', frame)

if cv2.waitKey(1) == 27:
    break

cv2.destroyAllWindows()

error
error Traceback (most recent call last)
in
23 blob = cv2.dnn.blobFromImage(frame, 1, (300, 300), (104, 177, 123))
24 net.setInput(blob)
—> 25 detect = net.forward()
26
27 detect = detect[0, 0, :, :]

error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-kh7iq4w7\opencv\modules\dnn\src\layers\convolution_layer.cpp:352: error: (-215:Assertion failed) !blobs.empty() || inputs.size() > 1 in function ‘cv::dnn::ConvolutionLayerImpl::getMemoryShapes’

Face recognition using cv2
what is the problem and what should i do
could anyone advice on this?