In trying to use the ImageClassifierData.from_paths for image classification, I get an output y tensor of all 0s, and then an error. Here is my code:
f_model = resnet34(pretrained=True)
def get_data(sz):
tfms = tfms_from_model(f_model, sz)
return ImageClassifierData.from_paths(path, bs=64, tfms=tfms, trn_name=‘input/train/’,test_name=‘input/test/’, val_name=‘working/valid/’,num_workers=1)
data = get_data(32)
x,y = next(iter(data.val_dl))
y
Which returns:
0 0 [torch.cuda.LongTensor of size 2 (GPU 0)]
And list(zip(data.classes, y[0])) throws:
TypeError: zip argument #2 must support iteration
Where have I gone wrong? Help appreciated!