Doing: Multiclass classification task.
Trying to test my model on a brand new test data set.
As per the above code, I got test_dls from learn.dls.test_dl(test_items)
. and and when trying to get TTA or run get_preds on it,
efficient_net_learner.tta(test_dls_new)
,
Learner Code: `from sklearn.metrics import accuracy_score, f1_score
from fastai.callback.fp16 import *
def train(tfms, item_tfms, model, lr, epoch = 2):
dls = ImageDataLoaders.from_folder(
data_dir,
train=‘.’,
valid_pct=0.2, # 20% of data used for validation
item_tfms=tfms, # Pre-process images to a consistent size
batch_tfms=item_tfms)
learn = vision_learner(dls=dls, arch = model, metrics=[error_rate, accuracy]).to_fp16()
learn.fit_one_cycle(epoch, lr)
return learn, dls,
# best of out of 3 , and best yet
efficient_net_learner, efficient_net_dls = train(tfms = RandomResizedCrop(224, min_scale=0.5), item_tfms = aug_transforms(mult=2), model = efficientnet_b3, lr = 1e-2, epoch = 3)`