PIL中分离通道发生“AttributeError: 'NoneType' object has no attribute 'bands'”
解决方法:
这个貌似是属于一个bug
把Image.py中的1500行左右的split函数改成如下即可:
def split(self):
"Split image into bands"
self.load()
if self.im.bands == 1:
ims = [self.copy()]
else:
ims = []
#self.load()
for i in range(self.im.bands):
ims.append(self._new(self.im.getband(i)))
return tuple(ims)
PIL中分离通道发生“AttributeError: 'NoneType' object has no attribute 'bands'”的更多相关文章
- AttributeError: 'NoneType' object has no attribute 'split' 报错处理
报错场景 social_django 组件对原生 django 的支持较好, 但是因为 在此DRF进行的验证为 JWT 方式 和 django 的验证存在区别, 因此需要进行更改自行支持 JWT 方式 ...
- Keras AttributeError 'NoneType' object has no attribute '_inbound_nodes'
问题说明: 首先呢,报这个错误的代码是这行代码: model = Model(inputs=input, outputs=output) 报错: AttributeError 'NoneType' o ...
- python3 AttributeError: 'NoneType' object has no attribute 'split'
from wsgiref.simple_server import make_server def RunServer(environ, start_response): start_response ...
- python提示AttributeError: 'NoneType' object has no attribute 'append'【转发】
在写python脚本时遇到AttributeError: 'NoneType' object has no attribute 'append' a=[] b=[1,2,3,4] a = a.appe ...
- python提示AttributeError: 'NoneType' object has no attribute 'append'
在写python脚本时遇到AttributeError: 'NoneType' object has no attribute 'append' a=[] b=[1,2,3,4] a = a.appe ...
- pyspark AttributeError: 'NoneType' object has no attribute 'setCallSite'
pyspark: AttributeError: 'NoneType' object has no attribute 'setCallSite' 我草,是pyspark的bug.解决方法: prin ...
- AttributeError: 'NoneType' object has no attribute 'extend'
Python使用中可能遇到的小问题 AttributeError: 'NoneType' object has no attribute 'extend' 或者AttributeError: 'Non ...
- 解决opencv:AttributeError: 'NoneType' object has no attribute 'copy'
情况一: 路径中有中文,更改即可 情况二:可以运行代码,在运行结束时显示 AttributeError: 'NoneType' object has no attribute 'copy' 因为如果是 ...
- appium 报错:AttributeError:"NoneType' object has no attribute 'XXX'
报错截图如下: 问题原因: 根据以上报错提示可已看到问题的原因为:logger中没有info此方法的调用,点击"具体报错的位置"上面的链接,可直接定位到具体的报错位置.根据分析所得 ...
随机推荐
- 【poj1739】 Tony's Tour
http://poj.org/problem?id=1739 (题目链接) 题意 给出一个n*m的地图,有些是障碍.问从左下角走遍所有非障碍格子一次且仅一次最终到达右下角的路径方案数. Solutio ...
- miniui前台无法显示数据
坑爹,刚开始使用miniui重写对账单的功能,显示数据的时候明明已经获取到json数据了,但前台还是显示不出来,找了一上午的原因,终于找到是因为前台显示字段的field值要改成和json中(数据库字段 ...
- supervisord安装使用简记
What is supervisor Supervisor is a client/server system that allows its users to monitor and control ...
- python下ssh的简单实现
python下的ssh都需要借助第三方模块paramiko来实现,在使用前需要手动安装. 一.python实现ssh (1) linux下的ssh登录 root@ubuntu:~# ssh morra ...
- CSS-学习笔记二
1. table标签中的标题 caption { caption-side: top; } 2.table标签中边框重合 table { width: 300px; height: 200px; bo ...
- 20145204&20145212信息安全系统实验一报告
信息安全系统实验报告 实验一 步骤 1.连接 arm 开发板 将 arm 开发板的电源线接好,使得开发板开关处于闭合状态.再分别将串口线.并口线和网线与 pc 机连接好. 2.建立超级终端 运行 wi ...
- 数据库性能优化常用sql脚本总结
最近闲来无事,正好抽出时间,来总结总结 sql性能优化方面的一下小技巧,小工具.虽然都是些很杂的东西,但是我个人觉得,如果真的清楚了里面的一下指标,或许真的能抵半个DBA. 有些时候,找不到DBA或者 ...
- Top 15 Java Utility Classes
In Java, a utility class is a class that defines a set of methods that perform common functions. Thi ...
- Fragment应用总结
1.FrameLayout 常用于作为Android自带组件的父节点 2.Fragment就是一个普通的Java类,用Android.app这个包 Fragment也是一个ListVi ...
- UI第八节——UISegmentedControl
- (void)viewDidLoad { [super viewDidLoad]; NSArray *items = @[@"消息", @"电话" ...