欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

AttributeError: ‘list‘ object has no attribute ‘ndim‘

发布时间:2024/7/5 编程问答 45 豆豆
生活随笔 收集整理的这篇文章主要介绍了 AttributeError: ‘list‘ object has no attribute ‘ndim‘ 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

错误:

AttributeError                            Traceback (most recent call last) <ipython-input-6-9b77ac20aa23> in <module>()1 # Print the `images` dimensions ----> 2 print(images.ndim)3 4 # Print the number of `images`'s elements5 print(images.size)AttributeError: 'list' object has no attribute 'ndim'

改正

#源代码 input=[1,2,3]#修改后 input=np.array(input)

总结

以上是生活随笔为你收集整理的AttributeError: ‘list‘ object has no attribute ‘ndim‘的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。