After executing a cell and get an error should it free the CUDA memory?

I mean like this

Also calling this line
data.show_batch(2, figsize=(10,7))

causes
| 0 16634 C ...tyoc213/anaconda3/envs/swift/bin/python 687MiB |

At the end I need to reset the kernel to free the memory, is this behaviour correct?

1 Like

If you find yourself in this situation, you can usually recover without restarting the kernel. Just intentionally cause an exception to be raised:

assert False
3 Likes