Skip to content

Conversation

@Haichao-Zhang
Copy link
Contributor

Provides an option to train and eval on the same shared env, mimicking the case such as training in real with only one physical env.

seed=seed)
if config.shared_train_eval_env:
self._env = alf.get_env()
self._env.reset()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert async_eval = False?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Added assertion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit not pushed to the right remote?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, yes, that was what happened ... now pushed

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

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()
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

for_evaluation=True,
num_parallel_environments=num_envs,
seed=seed)
if config.shared_train_eval_env:
Copy link
Contributor

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.

Copy link
Contributor

@emailweixu emailweixu Mar 24, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants