报错信息:
Implicit dimension choice for soft max has been deprecated. Change the call to include D_out = interp(model_D(F.softmax(pred)))
错误原因:
版本兼容问题。pytorch较高版本会出现此错误,在高版本中,softmax的隐式维度选择已弃用 。需要调用包含dim=X作为参数。
源码:
D_out = interp(model_D(F.softmax(pred)))
修改:
D_out = interp(model_D(F.softmax(pred, dim=1)))
报错信息:
IndexError: too many indices for array.
错误原因:
版本兼容问题。loss函数出错。
源码:
loss_semi_adv_value += loss_semi_adv.data.cpu().numpy()[0]/args.lambda_semi_adv
修改:
loss_semi_adv_value += loss_semi_adv.data.cpu().numpy()/args.lambda_semi_adv