# 1 load 2 info 3 resize 4 check import cv2 img = cv2.imread("image0.jpg", 1) imgInfo = img.shape print(imgInfo)
Attributeerror: ‘nonetype’ object has no attribute ‘shape’ error
The returned type may be none because the path is not set
The correct way is to write the path when reading the picture
import cv2 img = cv2.imread(r"D:\PythonCode\neuron\image0.jpg", 1) imgInfo = img.shape print(imgInfo)
Similar Posts:
- attributeError: ‘NoneType’ object has no attribute ‘shape’
- [Solved] tf.summary Error: tags and values not the same shape
- AttributeError: module ‘cv2’ has no attribute ‘CV_HAAR_SCALE_IMAGE’
- [Solved] PyTorch error: TypeError: ‘builtin_function_or_method‘ object is unsubscriptable
- [Solved] Tensorflow Error: ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type numpy.ndarray)
- Keras.utils.to in keras_ Categorical method
- The Usage of Numpy.unravel_index() function
- Python OpenCV BUG: all the input arrays must have same number of dimensions
- Tensorflowcenter {typeerror} non hashable type: “numpy. Ndarray”
- Scipy ValueError: ‘arr’ does not have a suitable array shape for any mode.