Open yzj0531 opened 3 years ago
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!
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
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!