Error: Number of input channels should be multiple of 3 but got 1 in function 'cv::dnn::ConvolutionLayerImpl::getMemoryShapes'

i’m having a hard time to believe it. (simply works for me …)

import cv2, numpy as np
print(cv2.__version__)

n = cv2.dnn.readNet("mdl.pb") # link taken from gh issue
print(n.empty())

im = cv2.imread("img.png") # your image above ! 
b = cv2.dnn.blobFromImage(im, size=(150, 150), swapRB=True, crop=False)
   
n.setInput(b)
o = n.forward()
print(o.shape)
print(np.argmax(o))

############
4.5.5-dev
False
(1, 29)
8