Skip to content

Commit

Permalink
Add a check for pretrained agents
Browse files Browse the repository at this point in the history
  • Loading branch information
araffin committed Nov 3, 2018
1 parent e14e949 commit 27c3284
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@

set_global_seeds(args.seed)

if args.trained_agent != "":
assert args.trained_agent.endswith('.pkl') and os.path.isfile(args.trained_agent), "The trained_agent must be a valid path to a .pkl file"

for env_id in env_ids:
tensorboard_log = None if args.tensorboard_log == '' else args.tensorboard_log + '/' + env_id

Expand All @@ -52,6 +55,9 @@
hyperparams = yaml.load(f)[env_id]

n_envs = hyperparams.get('n_envs', 1)

print("Using {} environments".format(n_envs))

# Should we overwrite the number of timesteps?
if args.n_timesteps > 0:
n_timesteps = args.n_timesteps
Expand Down

0 comments on commit 27c3284

Please sign in to comment.