From 4c0f48eb5879dc6009ad4f6f5c51ac63cbdde6bc Mon Sep 17 00:00:00 2001 From: Toru Urakawa Date: Wed, 11 Dec 2019 15:51:24 +0900 Subject: [PATCH] fix output paths for decoding results --- src/main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 8005a7e..d07b663 100755 --- a/src/main.py +++ b/src/main.py @@ -293,12 +293,14 @@ def decode_beam(model, test_dataloader, voc, device, args, logger, smethod, dat param_str = [str(s) for s in args.sparam] param_str= '_'.join(param_str) + outdir = str(args.out_dir) + if smethod == 'submod': - res_save_path= os.path.join('Output', 'results_{}_{}_{}_{}'.format(smethod, data_sub, args.slam, param_str)) - fres_save_path= os.path.join('Output', 'fres_{}_{}_{}_{}'.format(smethod, data_sub, args.slam, param_str)) + res_save_path= os.path.join(outdir, 'results_{}_{}_{}_{}'.format(smethod, data_sub, args.slam, param_str)) + fres_save_path= os.path.join(outdir, 'fres_{}_{}_{}_{}'.format(smethod, data_sub, args.slam, param_str)) else: - res_save_path= os.path.join('Output', 'results_{}_{}'.format(smethod, data_sub)) - fres_save_path= os.path.join('Output', 'fres_{}_{}'.format(smethod, data_sub)) + res_save_path= os.path.join(outdir, 'results_{}_{}'.format(smethod, data_sub)) + fres_save_path= os.path.join(outdir, 'fres_{}_{}'.format(smethod, data_sub)) np.save(res_save_path, all_results) np.save(fres_save_path, final_res)