【AttributeError: ‘NoneType‘ object has no attribute ‘shape‘】

【AttributeError: 'NoneType' object has no attribute 'shape'】

问题描述:

  • 使用OpenCV读取图片,报错:【AttributeError: ‘NoneType’ object has no attribute ‘shape’】

解决:

  • 检查图片的读取路径问题
  • 是否路径不对?
  • 图片是否存在?
  • 或者路径表示中的 ‘ / ’ ’ \ ’ 问题,导致图片没有读进代码中。

版权声明:本文为Kefenggewu_原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。