Hi, I am working on a multiclass (8 classes) single-label image classification problem. The CSV label file is one-hot encoded and the images are in a single folder. I am trying to use threshold accuracy metric (discussed in lesson 3) but it’s giving me dimension mismatch error. I am using the batch size of 32. Please guide me.
path = Path(r'D:\Manjeet Kaur\2019_dataset'); path.ls() tfms = get_transforms(flip_vert=True, max_lighting=0.1, max_zoom=1.05, max_warp=0.2) np.random.seed(42) bs=32 data = ImageDataBunch.from_folder(path, valid_pct=0.2, ds_tfms= tfms , size=128, bs=bs) data.normalize(imagenet_stats) arch = models.resnet50 acc_02 = partial(accuracy_thresh, thresh=0.2) learn = cnn_learner(data, arch, metrics=acc_02) learn.fit_one_cycle(5, max_lr=slice(0.01,0.1))