You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 (.0)
522
523 model.eval()
--> 524 best_loss = np.mean([calc_loss(loss_op, model(Variable(xv)), Variable(yv)).data.cpu().numpy()[0] for xv, yv in val_gen])
525 print("original val loss", best_loss)
526
IndexError: too many indices for array
Please let me know how I can fix it. Thank you!
The text was updated successfully, but these errors were encountered:
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])
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 (.0)
522
523 model.eval()
--> 524 best_loss = np.mean([calc_loss(loss_op, model(Variable(xv)), Variable(yv)).data.cpu().numpy()[0] for xv, yv in val_gen])
525 print("original val loss", best_loss)
526
IndexError: too many indices for array
Please let me know how I can fix it. Thank you!
The text was updated successfully, but these errors were encountered: