def confirm_image_suffix(self):
    print('开始校验所有图片后缀')
    for (index, img_name) in enumerate(self.img_list):
        print('{} image pass'.format(index), end='\r')
        if (not img_name.endswith(sample_conf['image_suffix'])):
            raise TrainError('confirm images suffix：you request [.{}] file but get file [{}]'.format(sample_conf['image_suffix'], img_name))
    print('所有图片格式校验通过')
def confirm_image_suffix(self):
    print('开始校验所有图片后缀')
    for (index, img_name) in enumerate(self.img_list):
        print('{} image pass'.format(index), end='\r')
        if (not img_name.endswith(sample_conf['image_suffix'])):
            raise TrainError('confirm images suffix：you request [.{}] file but get file [{}]'.format(sample_conf['image_suffix'], img_name))
    print('所有图片格式校验通过')