Skip to content

Commit

Permalink
Make sure training and validation data object are destroyed.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpf committed Nov 28, 2023
1 parent 87062dd commit c057e8f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gprof_nn/bin/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
networks for the GPROF-NN retrieval algorithm.
"""
import argparse
import gc
import logging
from concurrent.futures import ProcessPoolExecutor
from pathlib import Path
Expand Down Expand Up @@ -632,8 +633,9 @@ def run_training_1d(
LOGGER.info(f"Saving training network to {output}.")
xrnn.save(output)

del training_data
del validation_data
del training_data
gc.collect()
LOGGER.info(f"Training finished.")


Expand Down Expand Up @@ -849,6 +851,7 @@ def run_training_3d(

del training_data
del validation_data
gc.collect()
LOGGER.info(f"Training finished.")


Expand Down Expand Up @@ -1004,6 +1007,7 @@ def run_training_sim(

del training_data
del validation_data
gc.collect()
LOGGER.info(f"Training finished.")


Expand Down Expand Up @@ -1165,4 +1169,6 @@ def run_training_hr(configuration, training_data, validation_data, output, args)

del training_data
del validation_data
gc.collect()

LOGGER.info(f"Training finished.")

0 comments on commit c057e8f

Please sign in to comment.