I would like to use only label quality 2 as the validation dataset during training. Using Fastai have been trying to write the code but it won't work.
Can anyone please help with the code. Thank you.
You can create a valid column and set that col to True only for label quality =2
Something like
train.loc[train.label_quality==2,'valid']=
thank you, but I really don't understand the code. Should I create a seperate csv for the validation dataset containing only label quality 2 ?
Sorry. I was not clear. What I meant was:
train = pd.read_csv('/content/drive/My Drive/cgiar-wheat/Train.csv')
train['images'] = train['UID'].apply(lambda x: x + ".jpeg")
train['valid'] = False
train.loc[train.label_quality==2,'valid']= True
dls = ImageDataLoaders.from_df(train, fn_col='images',label_col='growth_stage', valid_col='valid',path='', folder='/content/Images/',y_block= RegressionBlock,bs=16,num_workers=0)
Thank you so much, it worked!
You can create a valid column and set that col to True only for label quality =2
Something like
train.loc[train.label_quality==2,'valid']=
thank you, but I really don't understand the code. Should I create a seperate csv for the validation dataset containing only label quality 2 ?
Sorry. I was not clear. What I meant was:
train = pd.read_csv('/content/drive/My Drive/cgiar-wheat/Train.csv')
train['images'] = train['UID'].apply(lambda x: x + ".jpeg")
train['valid'] = False
train.loc[train.label_quality==2,'valid']= True
dls = ImageDataLoaders.from_df(train, fn_col='images',label_col='growth_stage', valid_col='valid',path='', folder='/content/Images/',y_block= RegressionBlock,bs=16,num_workers=0)
Thank you so much, it worked!