IndexError: too many indices for array
Hi, I got the "IndexError: too many indices for array" error while I was running the file finetune_semeval_class-avg_f1. Here is more details:
torchMoji-master/torchmoji/finetuning.py in
Hello mhasan1, I solved this problem
From
best_loss = np.mean([calc_loss(loss_op, model(Variable(xv)), Variable(yv)).data.cpu().numpy()[0] for xv, yv in val_gen])
To
best_loss = np.mean([calc_loss(loss_op, model(Variable(xv)), Variable(yv)).data.cpu().numpy() for xv, yv in val_gen])
Thank you graykode! It's working now!