From bf9ce84fe45ad57a0477a056fd478db52c442006 Mon Sep 17 00:00:00 2001 From: Arec Jamgochian Date: Fri, 25 Feb 2022 00:42:44 -0800 Subject: [PATCH] changing when directory name gets saved --- sgail-ppo-options-setobs2.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sgail-ppo-options-setobs2.py b/sgail-ppo-options-setobs2.py index d875010..28f410b 100644 --- a/sgail-ppo-options-setobs2.py +++ b/sgail-ppo-options-setobs2.py @@ -17,6 +17,8 @@ from src.safe_options.options import SafeOptionsEnv from torch.utils.tensorboard import SummaryWriter from ray import tune +DIR = os.path.dirname(os.path.abspath(__file__)) + def training_function(config): obs_min = np.array([ [-1000, -1000, 0, -np.pi, -1e-1, 0.], @@ -63,10 +65,10 @@ def training_function(config): disc_opt = torch.optim.Adam(discriminator.parameters(), lr=config['discriminator']['learning_rate'], weight_decay=config['discriminator']['weight_decay']) expert_data = [ - torch.load(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'intersimple-expert-data-setobs2-loc0-track0.pt')), - torch.load(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'intersimple-expert-data-setobs2-loc0-track1.pt')), - torch.load(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'intersimple-expert-data-setobs2-loc0-track2.pt')), - torch.load(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'intersimple-expert-data-setobs2-loc0-track3.pt')), + torch.load(os.path.join(DIR, 'intersimple-expert-data-setobs2-loc0-track0.pt')), + torch.load(os.path.join(DIR, 'intersimple-expert-data-setobs2-loc0-track1.pt')), + torch.load(os.path.join(DIR, 'intersimple-expert-data-setobs2-loc0-track2.pt')), + torch.load(os.path.join(DIR, 'intersimple-expert-data-setobs2-loc0-track3.pt')), ] d0 = [d[0] for d in expert_data] d1 = [d[1] for d in expert_data]