赞
踩
- 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 elements
- 5 print(images.size)
- AttributeError: 'list' object has no attribute 'ndim'
It tried to get shape of input by reading ndim
attribute of numpy array and failed.
Just simply transform it using np.array
:
- import numpy as np
- ...
- images=np.array(images)
- labels=np.array(labels)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。