OpenCV(cv2)报错:‘NoneType‘ object has no attribute ‘shape‘

OpenCV(cv2)报错:‘NoneType‘ object has no attribute ‘shape‘_第1张图片
报错:
Traceback (most recent call last):
File “D:/Python/pytorchLearn/图片预处理/bitwise.py”, line 12, in
rows, cols, channels = img2.shape
AttributeError: ‘NoneType’ object has no attribute ‘shape’

解决办法:
opencv不能包含中文路径,全部修改成英文即可。

你可能感兴趣的:(人工智能,opencv,python,计算机视觉)