I’m trying to do multi-label image classification from scratch with se-resnext.
With this code,
data = image_data_from_csv(PATH, TRAINCUT, csv_labels=LABELS50CUT, valid_pct=0.1, sep=’ ‘, size=248, suffix=’.jpg’, bs=16, ds_tfms=([rand_crop()],[crop_pad()]))
def senext_101(notpre): return se_resnext101_32x4d(pretrained = None if notpre else ‘imagenet’)
learn = ConvLearner(data, senext_101, cut=5, ps=0, metrics=accuracy)
I get a working learner… well, almost working. It runs forward fine, but when calculating loss it turns out that train_dl labels are floats, when pytorch expects it to be longs.
image_data_from_csv is using ImageMultiDataset.from_folder , which explicitly creates target self.y with dtype=np.int64.
DataBunch.create() seems to be only taking datasets and passing them to Dataloader.
I tried the same approach for multi-class image classification and it works fine.
So any ideas where to look?