可以用来检测变量是否达到要求
比如
# check if h and w in record equals that read from img
assert img.shape[0] == int(h), \
"image height of {} inconsistent in record({}) and img file({})".format(
im_file, h, img.shape[0])
当图片的尺寸h和已知的h不同时
","后面的东西表示,如果发生错误输出的东西
\是分段符,没有实际作用