IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed
yzj0531 opened this issue · 1 comments
yzj0531 commented
File "train.py", line 355, in main
loss_semi_adv_value += loss_semi_adv.data.cpu().numpy()[0]/args.lambda_semi_adv
IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed
i need help, thanks!
yeeyangtee commented
you can try:
loss_semi_adv_value += loss_semi_adv.data.cpu().numpy().item()/args.lambda_semi_adv
For newer version of PyTorch, this is better:
loss_semi_adv_value += loss_semi_adv.item()/args.lambda_semi_adv