因为图片没有成功读取的原因,图片可能不存在~
类似的问题有AttributeError: ‘NoneType’ object has no attribute ‘copy
方法:

img = cv2.imread(img)
if img is None:
break

但是,也不能轻易就跳过,要找到究竟为什么读取不了图片