Skip to content
Snippets Groups Projects
Commit f744d97d authored by Michael Langguth's avatar Michael Langguth
Browse files

Trouble shooting in config_postprocess.py in case user only presses 'Enter'.

parent 92fcdfde
No related branches found
No related tags found
No related merge requests found
Pipeline #105962 failed
......@@ -78,7 +78,7 @@ class Config_Postprocess(Config_runscript_base):
_ = Config_Postprocess.get_subdir_list(dir_base)
# Chose the checkpoint directory
ckp_req_str = "Chose a checkpoint directory from the list above:"
ckp_req_str = "Choose a checkpoint directory from the list above:"
ckp_req_err = NotADirectoryError("Could not find the passed directory.")
dir_base = Config_Postprocess.keyboard_interaction(ckp_req_str, Config_Postprocess.check_dir, ckp_req_err,
prefix2arg=dir_base+"/", ntries=2)
......@@ -172,24 +172,23 @@ class Config_Postprocess(Config_runscript_base):
status = False
model_in = os.path.basename(model_path)
if model_in == "help":
if not silent:
print("**** Known models ****")
for model in Config_Postprocess.list_models:
print(model)
print("**** Known models ****")
model_in = os.path.basename(model_path) # try to infer model-name (empty in case user simply pressed enter)
if not os.path.isdir(model_path):
if model_in == "help" or not os.path.isdir(model_path):
if not silent:
print("The directory {0} does not exist".format(model_path))
if model_in != "help":
print("The directory {0} does not exist".format(model_path))
try:
_ = Config_Postprocess.get_subdir_list(os.path.dirname(model_path))
except:
print("The base directory does not exist as well!")
return status
if not model_in in Config_Postprocess.list_models:
if not model_in: # user just printed 'Enter'
_ = Config_Postprocess.get_subdir_list(os.path.dirname(model_path))
return status
if not model_in in Config_Postprocess.list_models :
if not silent:
print("%{0}: WARNING: Unknown model name passed, but trained model seems to be present. \n ".format(method) +
"Please delete the directory '{0}' if this is not the case!".format(model_path))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment