当前位置:网站首页>AttributeError: ‘NoneType‘ object has no attribute ‘shape‘
AttributeError: ‘NoneType‘ object has no attribute ‘shape‘
2022-07-24 05:15:00 【小新很新】
在运行训练文件时,出现了这样的问题:“AttributeError: ‘NoneType’ object has no attribute ‘shape’”。
原因: 1.图片不存在(路径不存在, 路径包含中文无法识别) 2.读取的图片内容和默认读取时参数匹配不匹配。(默认读取的是3通道的彩色图)例如读取到的图片是灰度图,就会返回None。3.当给出的路径不存在时, cv2.imread() 返回 None ,因此稍后将此 None 值视为 NumPy 数组时会发生错误。
有时可用 try except 语句跳过
eg:

边栏推荐
- Hcip day 3 - mGRE experiment
- frp内网穿透服务使用
- PXE efficient batch network installation
- 。 Single type digital sensing is an application 0 Up address is at the factory
- Ia notes 2
- jdbc封装一个父类减少代码重复
- [basic 7] - exceptions, capture and customize exceptions
- XML schema
- Image painting for irregular holes using partial revolutions paper notes
- Tips for using the built-in variable props of BeanShell
猜你喜欢

【sklearn】PCA

FRP intranet penetration service usage
![Embedded system transplantation [3] - uboot burning and use](/img/36/69daec5f1fe41bd3d0433d60816bba.png)
Embedded system transplantation [3] - uboot burning and use

Introduction to 51 single chip microcomputer (dedicated to the most understandable article for beginners)

PXE efficient batch network installation

Recursive cascade network: medical image registration based on unsupervised learning

太空可再生能源的代币化

Data annotation learning summary

JMeter FAQs
![Knowledge record of College Physics C in advance in summer [update]](/img/c4/76b669c3229a365a5e2567f7fb824e.png)
Knowledge record of College Physics C in advance in summer [update]
随机推荐
Emqx simple to use
The difference between run and start in thread class
[advanced mathematics] the difference between differentiable and differentiable functions
Context encoders: feature learning by painting paper notes
手写orm框架
【sklearn】数据预处理
Execution sequence of finally and return
Use of fiddler packet capturing tool
反射
finally和return的执行顺序
What are the core strengths of a knowledge base that supports customers quickly?
[Basic 6] - encapsulation and inheritance of classes, objects and classes
This article takes you to understand C string functions and memory functions in simple terms
Drools development decision table
网NN计算能主机系统资e提供的NTCP
Pointer learning diary (III)
Drools 开发决策表
Introduction to 51 single chip microcomputer (dedicated to the most understandable article for beginners)
Embedded system transplantation [2] - Construction of cross development environment
How to avoid the most common mistakes when building a knowledge base?