Skip to content
Snippets Groups Projects
Commit 539880fa authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Skip already processed folds.

parent 2e435fd6
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,7 @@ License
# -*- coding: utf-8 -*-
# builtins
import logging
from logging.config import dictConfig
# locals
......@@ -39,6 +40,9 @@ from pysegcnn.core.trainer import (DatasetConfig, SplitConfig, ModelConfig,
from pysegcnn.main.train_config import ds_config, ds_split_config, model_config
from pysegcnn.core.logging import log_conf
# module level logger
LOGGER = logging.getLogger(__name__)
if __name__ == '__main__':
......@@ -64,6 +68,12 @@ if __name__ == '__main__':
# (vii) instanciate the model state file for the current fold
state_file = net_sc.init_state(src_dc, src_sc, net_mc, fold=fold)
# check if the state file already exists
if state_file.exists() and not net_mc.checkpoint:
LOGGER.info('Fold already exists: {}'.format(state_file))
LOGGER.info('Moving to next fold ...')
continue
# (viii) instanciate logging configuration
net_lc = LogConfig(state_file)
dictConfig(log_conf(net_lc.log_file))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment