当前位置:网站首页>AttributeError: ‘NoneType‘ object has no attribute ‘shape‘
AttributeError: ‘NoneType‘ object has no attribute ‘shape‘
2022-07-24 05:27:00 【Xiaoxin is very new】
When running training files , There's a problem like this :“AttributeError: ‘NoneType’ object has no attribute ‘shape’”.
reason : 1. Picture does not exist ( path does not exist , The path contains Chinese, which is unrecognized ) 2. The content of the read image does not match the parameters of the default reading .( The default read is 3 A color map of the passage ) For example, the image read is a grayscale image , It will return None.3. When the given path does not exist , cv2.imread() return None , So this will be None Value as NumPy An error occurs when array .
Sometimes available try except Sentence skip
eg:

边栏推荐
猜你喜欢
随机推荐
AiN 0722 签到
Detailed explanation of string constant pool and intern() of string
【sklearn】RF 交叉验证 袋外数据 参数学习曲线 网格搜索
JDBC encapsulates a parent class to reduce code duplication
OSS文件上传
Machine vision learning summary
Learn AI linear regression from Li Mu. The code implementation from scratch is super detailed
赶紧进来!!轻松掌握C语言“顺序”、“分支”、“循环”三大结构
【常用技巧】
【Pytorch】nn.Module
Relationship between sample and population in Statistics: sample success ratio + central limit theorem (sample mean)
输入若干数据,找出最大值输出。(键盘和文件读取)
在屏幕上绘制一个运动的茶壶,茶壶先慢慢向屏幕里面移动,越变越小,越变越模糊;然后慢慢变大,越变越清晰,一直往返重复。为场景添加光照,材质和雾效果。通过键盘’a’’s’’d’来选择不同的雾效模式
Add, delete, modify and check JDBC
【【【递归】】】
SSM整合
C语言进阶篇 一.数据的存储
This is the first article
MQTT学习
C语言起步









