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

边栏推荐
猜你喜欢
随机推荐
【sklearn】RF 交叉验证 袋外数据 参数学习曲线 网格搜索
C语言进阶篇 六.文件的操作
Tips for using BeanShell built-in variable prev
reflex
使用swagger2markup生成API文档
【sklearn】PCA
线程的介绍
Generator generator, which generates only two methods
输入若干数据,找出最大值输出。(键盘和文件读取)
Cmake笔记
T 6-10
泛型和注解
【STL】Map &unordered_map
安装Pytorch+anaconda+cuda+cudnn
Introduction to reflection
OSS file upload
MQTT学习
Problems encountered in configuring Yum source
你真的知道判断语句吗?
6.在屏幕上绘制一条贝塞尔曲线和一个贝塞尔曲面








