Is it possible that you are doing something similar with any other variable? like labels? If labels are allocated on gpu, could you move them to cpu before enlisting them? In general you don’t have to save cuda variables without moving them to cpu before nor tensors which contains gradient tracks without detaching (and allocating on cpu). That’s typically the cause of your problem. Could you have a look at the rest of your code to see if you are doing something like that?