AttributeError: 'NoneType' object has no attribute 'shape'

even on read failure, you can avoid the exception:
height, width = np.shape(input)
# -> height == width == 0

but please, DO CHECK each imread() call, opencv does not throw , but returns invalid images(None) on failure (something, python noobs NEVER expect)

1 Like