Torchscript states device mismatch

I’m using the script in Detectron2 and receive this error. I’ve definitely successfully exported models with this script before, and ran them on cuda, no idea what’s changed.

Wonder if the error message might be misleading?

I don’t know which model you are using, but maybe this error is related to this one which also failed if the model was traced but I believe scripting worked.