欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

关于Numpy array类型 TypeError: 'tuple' object is not callable

程序员文章站 2022-05-29 08:04:24
...

**

若编码时会出现以下错误

**

from PIL import Image
a= Image.open('1.png')
a_num = np.array(a)
a_num.shape()

TypeError                                 Traceback (most recent call last)
<ipython-input-19-5a33b2b479d7> in <module>
----> 1 a_num.shape()

TypeError: 'tuple' object is not callable

将a_num.shape() -----> a_num.shape[:]

关于Numpy array类型 TypeError: 'tuple' object is not callable