title: 'NoneType' object has no attribute 'clip' error in ```cv2_imshow()```
body: <p>I was trying to create a program which could detect my face expression(from webcam).</p>
  <p>However, while displaying my face, I get the following error</p>
  <pre><code>---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-47-e0549b59dd89&gt; in &lt;module&gt;()
       47         print(&quot;\n\n&quot;)
       48 
  ---&gt; 49     cv2_imshow(frame)
       50     if cv2.waitKey(1) &amp; 0xFF == ord('q'):
       51         break
  
  /usr/local/lib/python3.6/dist-packages/google/colab/patches/__init__.py in cv2_imshow(a)
       20       image.
       21   &quot;&quot;&quot;
  ---&gt; 22   a = a.clip(0, 255).astype('uint8')
       23   # cv2 stores colors as BGR; convert to RGB
       24   if a.ndim == 3:
  
  AttributeError: 'NoneType' object has no attribute 'clip'
  </code></pre>
  <p>I am using Python 3.6 on Google Colab.</p>
  <p>I am using <code>cv2_imshow()</code> from Google patches, since Colab does not support <code>cv2.imshow()</code></p>
  <p>Here is my code:</p>
  <pre><code>from google.colab.patches import cv2_imshow
  from keras.models import load_model
  from time import sleep
  from keras.preprocessing.image import img_to_array
  from keras.preprocessing import image
  import cv2
  import numpy as np
  
  face_classifier = cv2.CascadeClassifier('/content/drive/My Drive/Colab Notebooks/haarcascade_frontalface_default.xml')
  classifier = load_model('/content/drive/My Drive/Colab Notebooks/fer_68acc.h5')
  
  class_labels = ['Angry','Happy','Neutral','Sad','Surprise']
  
  cap = cv2.VideoCapture(0)
  
  
  
  while True:
      # Grab a single frame of video
      ret, frame = cap.read()
      labels = []
      gray = cv2.imread(frame, cv2.IMREAD_GRAYSCALE)
      faces = face_classifier.detectMultiScale(gray,1.3,5)
  
      for (x,y,w,h) in faces:
          cv2.rectangle(frame,(x,y),(x+w,y+h),(255,0,0),2)
          roi_gray = gray[y:y+h,x:x+w]
          roi_gray = cv2.resize(roi_gray,(48,48),interpolation=cv2.INTER_AREA)
  
  
          if np.sum([roi_gray])!=0:
              roi = roi_gray.astype('float')/255.0
              roi = img_to_array(roi)
              roi = np.expand_dims(roi,axis=0)
  
          # make a prediction on the ROI, then lookup the class
  
              preds = classifier.predict(roi)[0]
              print(&quot;\nprediction = &quot;,preds)
              label=class_labels[preds.argmax()]
              print(&quot;\nprediction max = &quot;,preds.argmax())
              print(&quot;\nlabel = &quot;,label)
              label_position = (x,y)
              cv2.putText(frame,label,label_position,cv2.FONT_HERSHEY_SIMPLEX,2,(0,255,0),3)
          else:
              cv2.putText(frame,'No Face Found',(20,60),cv2.FONT_HERSHEY_SIMPLEX,2,(0,255,0),3)
          print(&quot;\n\n&quot;)
      
      cv2_imshow(frame)
      if cv2.waitKey(1) &amp; 0xFF == ord('q'):
          break
  
  cap.release()
  cv2.destroyAllWindows()
  </code></pre>
  <p>Could someone please help?
  Unfortunately, I can not run this on my local machine, so it would be helpful if someone gave a solution which can be run on Google Colab.</p>
  <p>Thanks</p>