def check(lists, start, end, index):
    for (i, item) in enumerate(lists[start:end]):
        try:
            items = item.split()
            if (len(items) >= 1):
                path = items[0].strip().strip('\n')
            else:
                print(('skip line %s' % i))
                continue
            path = os.path.join(args.root, os.path.join('train', path))
            imgs = Image.open(path)
            imgs.resize((256, 256))
            if (index == 0):
                print(i, end='\r', file=sys.stderr)
        except (RuntimeError, IOError):
            print(('\nError when read image %s' % path))
    print('\nFinish checking', index)
def check(lists, start, end, index):
    for (i, item) in enumerate(lists[start:end]):
        try:
            items = item.split()
            if (len(items) >= 1):
                path = items[0].strip().strip('\n')
            else:
                print(('skip line %s' % i))
                continue
            path = os.path.join(args.root, os.path.join('train', path))
            imgs = Image.open(path)
            imgs.resize((256, 256))
            if (index == 0):
                print(i, end='\r', file=sys.stderr)
        except (RuntimeError, IOError):
            print(('\nError when read image %s' % path))
    print('\nFinish checking', index)