-
Notifications
You must be signed in to change notification settings - Fork 58
shared_train_eval_env #1732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pytorch
Are you sure you want to change the base?
shared_train_eval_env #1732
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,10 +74,15 @@ def __init__(self, config: TrainerConfig, conf_file: str): | |
| pre_configs, num_envs, config.root_dir, seed)) | ||
| self._worker.start() | ||
| else: | ||
| self._env = create_environment( | ||
| for_evaluation=True, | ||
| num_parallel_environments=num_envs, | ||
| seed=seed) | ||
| if config.shared_train_eval_env: | ||
| assert not self._async, "should not use async_eval in shared_train_eval_env mode" | ||
| self._env = alf.get_env() | ||
| self._env.reset() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. assert async_eval = False?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. Added assertion.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commit not pushed to the right remote?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, yes, that was what happened ... now pushed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happened to me also. It's hard to remember, especially now that we don't change alf that often. We can probably remove the other remote.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Curious, why do we call env.reset() here but not in the other branch. Maybe add a comment in the code? |
||
| else: | ||
| self._env = create_environment( | ||
| for_evaluation=True, | ||
| num_parallel_environments=num_envs, | ||
| seed=seed) | ||
| self._evaluator = SyncEvaluator(self._env, config) | ||
|
|
||
| def eval(self, algorithm: RLAlgorithm, step_metric_values: Dict[str, int]): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to set the step_type in the replay buffer just before evaluation started to StepType.LAST.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need to set the next step type for training to FIRST