python下报错AttributeError: 'NoneType' object has no attribute 'shape'

在运行image=cv2.imread(image[k])之后,出现错误AttributeError: 'NoneType' object has no attribute 'shape'

检查了图片的格式是jpeg;在另一个程序中这条命令处理其他图片是成功执行的,因此排除系统opencv安装出错;

查阅了一些网上的资料:

ref https://ziyubiti.github.io/2016/06/15/imreaderror/

https://blog.csdn.net/ll523587181/article/details/79611828

https://blog.csdn.net/tina_ttl/article/details/51800635#21-importerror-no-module-named-cv2

后来发现这个链接对我帮助最大 http://www.cnblogs.com/yizhaoAI/p/8621232.html

图片路径没有写对......改正之后正常运行啦

猜你喜欢

转载自blog.csdn.net/sinat_22147265/article/details/82349633
今日推荐