Closed lukas-ruettgers closed 8 months ago
Hi, thanks for the feedback.
The evaluation script in ManiSkill2 repo is a general script that doesn't bind to a specific learning repo. Indeed, if you use a specific learning repo like ManiSkill2-Learn, you need to write your own user_solution.py
, and then use the evaluation script in ManiSkill2 to evaluate it.
We used to have a submission_example
in ManiSkill2-Learn, but since we are moving to gymnasium and updating our repo, it was since removed from the main branch. You can view it here:
https://github.com/haosulab/ManiSkill2-Learn/tree/ms2_gym/submission_example
Thank you for your fast reply!
Missing VecEnv Wrapper
For submission, you provided the
run_evaluation.py
andevaluator.py
scripts in the ManiSkill2 repository (/mani_skill2/evaluation/
).In the
Evaluation
class in your ManiSkill2-Learn repository (maniskill2_learn/env/evaluation.py
), you correctly wrap the raw OpenAI gym environment with your MS2-specific wrappers (UnifiedVectorEnvAPI<VectorEnvBase<BufferAugmentedEnv<ExtendedEnv<TimeLimit<ManiSkill2_ObsWrapper<RenderInfoWrapper<...>>>>>>).But in the
evaluator.py
script, you do not wrap the raw Gymnasium environment with these wrappers.This is problematic because our trained models rely on the frame transformations, normalizations, downsampling, and shape adjustments of the observations.
Therefore, we added these wrappers in our code, but this is definitely not desirable.
Inconsistent observation shapes
Furthermore, the values in
self.env.observation_space
are inconsistent with those provided byget_env_info()
in themaniskill2_learn.env
folder.To obtain the size of the
state
vector, we summed up the sizes of all corresponding vectors inself.env.observation_space
in the following fashion.However, the final value in
state_shape
exceeds the true value provided byget_env_info()
by 8 in case of theStackCube-v0
andTurnFaucet-v0
environments. Of course, we replaced the env_name in our environment configenv_cfg
by the value inenv_id
.For the
StackCube-v0
environment, we havestate_shape
=32, while the value inenv_params
is 24. For theTurnFaucet-v0
environment, we similarly havestate_shape
=39, while the value inenv_params
is 31.The latter way of computing the observation shapes with
get_env_info()
is also used in your aforementionedEvaluation
class and is hence consistent with the values received during training. In ouruser_solution.py
, we thus ignored theobservation_spaces
parameter and instead fetched the space specifications fromget_env_info()
.But we think this might possibly be an error in your example script.