已解决AttributeError: ‘list‘ object has no attribute ‘shape‘

已解决AttributeError: ‘list’ object has no attribute ‘shape’

在这里插入图片描述

报错问题

之前在工作中遇到过这个坑,记录一下问题以及解决方法,不一定针对所有情况都能用,但是可以供大家参考。
问题描述如下:

AttributeError: ‘list’ object has no attribute ‘shape’

在这里插入图片描述

解决方法

在这里插入图片描述
“list”对象没有属性“shape”

将列表转为array格式,然后使用shape即可!

list_shape = np.array(list_01).shape
print(list_shape)

PS

有问题评论区留言即可

猜你喜欢

转载自blog.csdn.net/weixin_50843918/article/details/130009797
今日推荐