diff --git a/climax/main/downscale_infer.py b/climax/main/downscale_infer.py index a023e00c2b73128ff8d1709fb4e51ce0ecef79af..050fc5d21650403efc14a14d8514a55e0bbd6aaa 100644 --- a/climax/main/downscale_infer.py +++ b/climax/main/downscale_infer.py @@ -55,6 +55,11 @@ if __name__ == '__main__': LOGGER.info('{} does not exist.'.format(state_file)) sys.exit() + # initialize logging + log_file = MODEL_PATH.joinpath(PREDICTAND, + state_file.name.replace('.pt', '_log.txt')) + dictConfig(log_conf(log_file)) + # check if target dataset already exists target = TARGET_PATH.joinpath(PREDICTAND, net.state_file.name.replace( net.state_file.suffix, '.nc')) @@ -62,11 +67,6 @@ if __name__ == '__main__': LogConfig.init_log('{} already exists.'.format(target)) sys.exit() - # initialize logging - log_file = MODEL_PATH.joinpath(PREDICTAND, - state_file.name.replace('.pt', '_log.txt')) - dictConfig(log_conf(log_file)) - # predict reference period LogConfig.init_log('Predicting reference period: {}'.format( ' - '.join([str(VALID_PERIOD[0]), str(VALID_PERIOD[-1])])))