当前位置:   article > 正文

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

list' object has no attribute 'ndim

错误:

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

改正

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/秋刀鱼在做梦/article/detail/782824
推荐阅读
相关标签
  

闽ICP备14008679号