title: Why do I get this cv2.error when I set the net.forward output?
body: <p>I'm doing some machine learning object detection with cv2 and I always get a cv2.error:</p>
  <blockquote>
  <p>OpenCV(4.0.0) C:\projects\opencv-python\opencv\modules\dnn\src\layers\convolution_layer.cpp:1114: error: (-215:Assertion failed) inputs[0].size[1] % blobs[0].size[1] == 0 in function 'cv::dnn::ConvolutionLayerImpl::forward'</p>
  </blockquote>
  <pre><code>net = cv2.dnn.readNet(&quot;yolov3.weights&quot;,&quot;yolov3.cfg&quot;)
  
  layer_names = net.getLayerNames()
  output_layers = [layer_names[i[0]-1] for i in net.getUnconnectedOutLayers()]
  
  img = op('null1').numpyArray(delayed=True)
  #print(img.dtype)#float32
  
  gray = cv2.cvtColor(img,cv2.COLOR_RGB2GRAY)
  gray = (gray *255).astype(np.uint8)
  #print(gray.dtype)#uint8
  
  blob = cv2.dnn.blobFromImage(img,1/255,(416,416),(0,0,0),swapRB=True,crop=False)
  
  net.setInput(blob)
  
  out = net.forward(output_layers)#!!! HERE OCCURS MY ERROR
  </code></pre>
  <p>Anyone a suggestion what causes this error?
  Do I have to change the pixelformat?</p>