Hello, I am trying to do the dog breed identification challenge and when I try to run this code, it gives me this error, I’m not sure if it’s something I’m doing or the fastai library itself:
to be honest, I can’t figure out why ‘trn[1].shape[1]’ is there… I quess there should be additional if:
if len(trn[1].shape==1): 1
else: len(trn[1].shape[1]
reason could be that we are trying to initialize second dimension (width) to labels. So, if there are more than one label, eg.multilabel classification then len(trn[1].shape[1]) > 1. That is my interpretation of this code. As always I could be mistaken again
That could be because of latest updated in fasta.ai . My code was working fine until yesterday that I updated my fork from the latest version of the upstream and now I see this error. A fix
est_lbls = np.zeros((len(test), trn[1].shape[1] if len(trn[1].shape) > 1 else 1))