Split_By_Folder Error? IndexError

Am I doing anything wrong with the way I am creating my learn object? Please let me know! I usually just split by folder with a random validation set, but now I want more control so I would like to select a folder.

def createModel_train_valid(size, bs,
                            wd=1e-2, pretrained='None', unfreeze=False, show_batch=False, seed=2019):

    codes = ["background", "pneumothorax"]

    path_data = pathSSD/'training-ground'
    size = size
    bs = bs
    wd = wd
    metrics = [dice]

    src = (SegmentationItemList.from_folder(path_data, convert_mode='L')
           .split_by_folder(trainfolder, validfolder)
           .label_from_func(get_y_fn, classes=codes))

    data = (src.transform(get_transforms(do_flip=True,
                                         max_rotate=30,  # Increased
                                         # max_zoom=1.0, ### Increased
                                         # max_lighting=0.1,
                                         max_warp=0.0,  # Increased
                                         p_affine=0.4,  # Increased
                                         ), size=size, tfm_y=True)

    learn = unet_learner(data, models.resnet34,
                         metrics=metrics, wd=wd,

    if pretrained != 'None':
        if unfreeze:
        print('loaded pretrained model...')

    return learn

Figured out the bug. Looks like the trainfolder and validfolder must point directly to the images. (I had assumed it would search for children of the specified folder). I ended up rearranging my data as follows: