问题描述

DisabledFunctionError: cv2.imshow() is disabled in Colab, because it causes Jupyter sessions to crash; see https://github.com/jupyter/notebook/issues/3935.

问题解决

如果使用的是 google colab,用此解决方案,替换报错的那一行:

from google.colab.patches import cv2_imshow
cv2_imshow(img)

当然还有其它的解决方案!!
参考:
https://github.com/jupyter/notebook/issues/3935
https://www.cnblogs.com/lfri/p/10498876.html