Ram problem on Colab for a while with my model validation data.
Can anyone help me to solve this problem please
# Définition des identifiants d'entrainement et de patch de test, prendre 80 % pour l'entrainement
# Definition of the train and test patch IDs, take 80 % for train
test_ID = [0, 8, 16, 18, 20]
test_eopatches = [sampled_eopatches[i] for i in test_ID]
train_ID = [i for i in range(len(patchIDs)) if i not in test_ID]
train_eopatches = [sampled_eopatches[i] for i in train_ID]
# Définissez les fonctionnalités et les étiquettes pour les ensembles d'entraînement et de test
# Set the features and the labels for train and test sets
features_train = np.concatenate([eopatch.data["FEATURES_SAMPLED"] for eopatch in train_eopatches], axis=1)
labels_train = np.concatenate([eopatch.mask_timeless["LULC_ERODED"] for eopatch in train_eopatches], axis=0)
features_test = np.concatenate([eopatch.data["FEATURES_SAMPLED"] for eopatch in test_eopatches], axis=1)
labels_test = np.concatenate([eopatch.mask_timeless["LULC_ERODED"] for eopatch in test_eopatches], axis=0)
# Obtention du shape d'entrainement
# Get shape
t, w1, h, f = features_train.shape
t, w2, h, f = features_test.shape
# Remodeler à n x m
# Reshape to n x m
features_train = np.moveaxis(features_train, 0, 1).reshape(w1 * h, t * f)
labels_train = labels_train.reshape(w1 * h)
features_test = np.moveaxis(features_test, 0, 1).reshape(w2 * h, t * f)
labels_test = labels_test.reshape(w2 * h)