-
Notifications
You must be signed in to change notification settings - Fork 15
Fix/visualizer inherit config #246
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: 3.0
Are you sure you want to change the base?
Conversation
…0.bin 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- Add --config CLI flag to visualize.c for custom INI file - Add _write_visualizer_config() to generate config from driver_env - Handle special attribute mappings (action_type -> _action_type_flag) - Pick random map from training map_dir when render_map not specified 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Greptile SummaryThis PR enables the visualizer to inherit environment configuration from the training process instead of always using default values. The changes introduce a new Key Changes:
Issues Found:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Train as Training Process
participant Utils as render_videos()
participant Helper as _write_visualizer_config()
participant ConfigFile as visualizer_config.ini
participant Visualizer as C Visualizer (./visualize)
Train->>Utils: Call render_videos(config, vecenv, ...)
Utils->>Utils: Get env_cfg from vecenv.driver_env
Utils->>Helper: Call _write_visualizer_config(env_cfg, temp_config_path)
Helper->>Helper: Read base INI (pufferlib/config/ocean/drive.ini)
Helper->>Helper: Override [env] values with env_cfg attributes
Helper->>ConfigFile: Write modified config to temp path
Helper-->>Utils: Return (config written)
Utils->>Utils: Build command with --config flag
Utils->>Visualizer: Execute ./visualize --config temp_config_path
Visualizer->>Visualizer: Parse config_file (or use default if NULL)
Visualizer->>Visualizer: Load environment configuration from INI
Visualizer->>Visualizer: Generate visualization with training env settings
Visualizer-->>Utils: Return rendered video
Utils->>Train: Log video to wandb
|
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.
4 files reviewed, 1 comment
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Currently the visualizer draws its config during training directly from the ini file. So, if we pass important things as CLI args, they aren't included during the visualization process. This writes the CLI args to a new config so that they are correctly pulled in during visualization.