I’m having some trouble creating a data block and keep receiving the error ‘RuntimeError: The size of tensor a (115) must match the size of tensor b (64) at non-singleton dimension 1’
I am trying to train my resnet34 model on the fruits-360 dataset from kaggle.
This is my code:
np.random.seed(42) data = (ImageList.from_folder(fruits_path) .split_by_rand_pct(0.2) .label_from_folder() .transform(get_transforms(), size=128) .databunch().normalize(imagenet_stats)) architecture = models.resnet34 acc_02 = partial(accuracy_thresh, thresh=0.2) f_score = partial(fbeta, thresh=0.2) learn = cnn_learner(data, architecture, metrics=[acc_02, f_score]) lr = 0.01 learn.fit_one_cycle(5, slice(lr))
Any help would be really appreciated! Thanks!