Fix missing type variable in policy confg.json file after training #52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this does
Fixes: when using train.py or, for example, 3_train_policy.py on either a real robot database or a simulated database, the output policy config.json file is missing the policy type line, such as "type": "act". When an evaluation script, such as eval.py or 2_evaluate_pretrained_policy.py tries to read the config.json file it fails with an error:
ParsingError(f"Expected a dict with a '{CHOICE_TYPE_KEY}' key for {cls}, got {raw_value}").
Label: (🐛 Bug)
To fix:
In
lerobot/common/policies/act/configuration_act.py:In
lerobot/common/policies/diffusion/configuration_diffusion.py:How it was tested
Before fix: Evaluating a learned policy, e.g. using eval.py gave ParsingError(f"Expected a dict with a '{CHOICE_TYPE_KEY}' key for {cls}, got {raw_value}") and exited.
After fix: No errors when evaluating, e.g. using eval.py.
Tested scenarios:
How to checkout & try? (for the reviewer)
Test with the pushT example scripts: