Quite frequently Google Colab gets hung up on extremely simple cells (stuff like setting variables or defining a function--not evaluating!).
For a very explicit example, I just started a new runtime and evaluated cell 1 (below). Then colab got hung on evaluating cell 2:
Cell 1 (ran):
import numpy as np
import scipy.sparse as sparse
import matplotlib.pyplot as plt
Cell 2 (stopped colab):
delta_t = .01
This appears to have nothing to do with how many cells have been evaluated -- sometimes it gets hung up on the first cell.
This is obviously quite annoying as the only solution is to restart the entire runtime.
However I have noticed that I can sometimes copy the code to a new cell, and then evaluate it there. I.e. while the first cell is still trying to evaluate, I can run the same code in a different cell and have it successfully complete.
Is there anything I can do to avoid this?