Why does pytorch prompt "[W accumulate_grad.h:170] Warning: grad and param do not obey the gradient layout contract. This is not an error, but may impair performance."?

I solved this warning by adding inplace=False in the Relu() of model building. This may be helpful to other cases.

1 Like