Hi,
If you can try to get a small code sample that reproduces the issue, that would help a lot to find out what the problem is.
My approach for this is usually, in a new file:

copy/paste your modules definitions
copy/paste your training inner loop
add code that generate one random input

If the error does not appear any-more, add back more things from your model initialization / data preprocessing.
If the error still occurs, start removing stuff from this new file until it disappears.
Once you have such a minimal example, could you post it here?