I created a DataGenerator
with Sequence class.
import tensorflow.keras as keras
from skimage.io import imread
from skimage.transform import resiz
You can write this code to avoid timeout in google colab in console
ConnectButton() {
console.log("Connect pushed");
document.querySelector("#top-toolbar > colab-connect-
button").shadowRoot.querySelector("#connect").click()
}
setInterval(ConnectButton,60000);
Source: How to prevent Google Colab from disconnecting?
The problem seems to be the input. Your model cannot find the input file. If you change runtime then there's gonna be a factory reset. All your disk content in the session will be erased.
Run cells from the beginning if you change runtime in between.