Hello OG!



 Mr_OG:

my error is with the gradient computation which probably has been modified by an inplace operation that I cant find. maybe it is in my loss function?


Please see if you can reproduce your error in a simple script of ten
or twenty lines.  The idea would be that you generate some random
example data, call your loss function, and call backward, at which
point the error occurs.
Make sure that the script is complete, self-contained, and runnable.
Leave out any unnecessary complications such as training loops, data
loaders, models, etc.  Please don’t import any non-pytorch packages.
For example, if your loss function comes from a third-party package,
please just include a stripped-down version of the loss-function code
in your self-contained script.
Then post the runnable script and also post the complete output you
get when you run it, including the error.
Best.
K. Frank