Hi everyone, i’m having the error from the title in a text Multilabel Classification problems. My data is already tokenized, so I use
data_clas = TextClasDataBunch.from_ids(dir_path,train_ids,train_lbls,val_ids,val_lbls, 258, bs = 16)
to create my DataBunch. I then create a RNNLearner with :
learn = RNNLearner.classifier(data_clas, bptt = bptt, max_len = bptt*20 ,qrnn=_p.qrnn, drop_mult=0.3)
I make sure i have the loss i want with :
learn.loss_func = torch.nn.functional.binary_cross_entropy_with_logits
Now i want to find the best learning rate, so I do
But i get the following error :
RuntimeError: TensorIterator expected type torch.cuda.DoubleTensor but got torch.cuda.FloatTensor[8, 5]
I have 5 labels so that’s where the 5 is coming from. The weird thing is that i do almost the same exact thing with another dataset, the only difference being using TextClasDataBunch.from_id_files instead of TextClasDataBunch.from_id and it works perfectly there.
Any tips to solve that error would be welcomed
PS : I’m not on the latest commit of fastai, i’m just before the refactoring of NLP.