Try to restart the Python kernel in the Jupyter notebook or execute the Python script through the terminal directly. If you are rerunning cells after an assert is triggered, the error will just be raised again, since the CUDA context is corrupted.