Could you run the code on a local machine in a terminal to get a proper error message?
I’m not sure, if you can observe the RAM utilization in Colab, but if so you could check if you are really running out of memory.