当前位置:网站首页>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:

边栏推荐
猜你喜欢
随机推荐
C语言实现三子棋?五子棋?不,是n子棋
Tips for using the built-in variable vars in BeanShell
Skills of BeanShell dealing with JSON
深度剖析数据在内存中的存储
c语言中的变量与常量
Tips for using the built-in variable props of BeanShell
NFS shared services
AttributeError: ‘NoneType‘ object has no attribute ‘shape‘
用双向链表实现栈(C)
Relationship between sample and population in Statistics: sample success ratio + central limit theorem (sample mean)
利用二分法从数组中寻找具体数值
web开发
求网络的flops
Read "effective managers - Drucker"
【Pytorch】Dataset_DataLoader
T 6-10
Text summary acl2021
空杯心态,重新开始
T 11-20
JMeter FAQs








