protomotions.utils.inference_utils module¶
Inference-specific utility functions.
This module contains utilities specific to inference mode.
For general config override utilities, see protomotions.utils.config_utils
- protomotions.utils.inference_utils.apply_all_inference_overrides(robot_config, simulator_config, env_config, agent_config, experiment_module=None, args=None)[source]¶
Apply all inference overrides (standard + experiment + CLI).
This is the main entry point for inference configuration adjustments. Inference uses frozen configs from resolved_configs_inference.pt plus inference-specific overrides.
- Parameters:
robot_config – Robot configuration to modify
simulator_config (SimulatorConfig) – Simulator configuration to modify
env_config (EnvConfig) – Environment configuration to modify
agent_config – Agent configuration to modify (can be None for inference)
experiment_module – Optional experiment module for apply_inference_overrides()
args – Optional command line arguments
- protomotions.utils.inference_utils.apply_backward_compatibility_fixes(robot_config, simulator_config=None, env_config=None)[source]¶
Apply backward compatibility fixes to loaded configs from older checkpoints.
This function patches configs that are missing fields added in newer versions. Each fix should be independent and check if the field is missing before applying.
For large refactors, it’s recommended to use
train_agent.py --create-config-onlyto re-create configs and then use the old weights checkpoint with--checkpoint. But this function can be handy to fix small changes in config system.- Parameters:
robot_config (Any) – Robot configuration that may be missing newer fields
simulator_config (SimulatorConfig) – Optional simulator configuration for migration fixes
env_config (EnvConfig) – Optional environment configuration for migration fixes