From d00f3bce34e3f39b33742d61fdf64df7fc165399 Mon Sep 17 00:00:00 2001 From: Peter Zhokhov Date: Tue, 30 Oct 2018 09:47:39 -0700 Subject: [PATCH] syntax and flake8 --- baselines/ppo2/ppo2.py | 2 +- baselines/trpo_mpi/trpo_mpi.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/baselines/ppo2/ppo2.py b/baselines/ppo2/ppo2.py index 5e6aa30..70df06d 100644 --- a/baselines/ppo2/ppo2.py +++ b/baselines/ppo2/ppo2.py @@ -403,7 +403,7 @@ def learn(*, network, env, total_timesteps, eval_env = None, seed=None, nsteps=2 logger.logkv(lossname, lossval) if MPI is None or MPI.COMM_WORLD.Get_rank() == 0: logger.dumpkvs() - if save_interval and (update % save_interval == 0 or update == 1) and logger.get_dir() and (MPI is None or MPI.COMM_WORLD.Get_rank() == 0): + if save_interval and (update % save_interval == 0 or update == 1) and logger.get_dir() and (MPI is None or MPI.COMM_WORLD.Get_rank() == 0): checkdir = osp.join(logger.get_dir(), 'checkpoints') os.makedirs(checkdir, exist_ok=True) savepath = osp.join(checkdir, '%.5i'%update) diff --git a/baselines/trpo_mpi/trpo_mpi.py b/baselines/trpo_mpi/trpo_mpi.py index cd45775..17d9e5c 100644 --- a/baselines/trpo_mpi/trpo_mpi.py +++ b/baselines/trpo_mpi/trpo_mpi.py @@ -365,7 +365,7 @@ def learn(*, lrlocal = (seg["ep_lens"], seg["ep_rets"]) # local values if MPI is not None: listoflrpairs = MPI.COMM_WORLD.allgather(lrlocal) # list of tuples - else + else: listoflrpairs = [lrlocal] lens, rews = map(flatten_lists, zip(*listoflrpairs))