Your workflow sounds reasonable. Could you post a small code snippet reproducing this issue, if that’s possible?
Also, are you sure the error points to bn2?
Make sure to call your script using CUDA_LAUNCH_BLOCKING=1 python script.py args if you are using your GPU. Otherwise due to the asynchronous CUDA calls the stack trace might point to a wrong line of code.