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

边栏推荐
- JDBC MySQL basic operations
- Jetson device failed to download repository information use tips to record
- Globally and locally consistent image completion paper notes
- Support complex T4 file systems such as model group monitoring and real-time alarm. e
- 反射的介绍
- frp内网穿透服务使用
- 【NumPy】
- C table data De duplication
- jdbc的增删改查
- )To feed back to the application layer or into multiple format documents:
猜你喜欢

Read "effective managers - Drucker"

IDEA:SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“.

View progress!!! RPM installation!!!

DHCP principle and configuration

Do you want to have a robot that can make cartoon avatars in three steps?

Data annotation learning summary

Hcip day 3 - mGRE experiment

Machine vision learning summary

FTP file transfer protocol

Tips for using the built-in variable props of BeanShell
随机推荐
What are the core strengths of a knowledge base that supports customers quickly?
酒店IPTV数字电视系统解决方案
[database connection] - excerpt from training
Pointer learning diary (I)
Learning some contents of vector and iterator
利用a*启发式搜索解决迷宫寻路问题
1、基于增量式生成遮挡与对抗抑制的行人再识别
How to avoid the most common mistakes when building a knowledge base?
FTP file transfer protocol
Hcip day 3 - mGRE experiment
[Huang ah code] Introduction to MySQL - 3. I use select *, and the boss directly rushed me home by train, but I still bought a station ticket
generator生成器,只生成两个方法
finally和return的执行顺序
HCIA NAT experiment
Reading excerpts from Liu run's "bottom logic"
Scikit learn -- steps of machine learning application development
Basic knowledge of MySQL database
Beginners' preparation for the Blue Bridge Cup (University Programming learning history records, topic ideas for students who need to prepare for the Blue Bridge Cup)
Hcip-- review the homework for the next day
【sklearn】tree.DecisionTreeClassifier