Adding Rendering Support for Human Replay Evals#311
Open
Aditya-Gupta26 wants to merge 4 commits into3.0_betafrom
Open
Adding Rendering Support for Human Replay Evals#311Aditya-Gupta26 wants to merge 4 commits into3.0_betafrom
Aditya-Gupta26 wants to merge 4 commits into3.0_betafrom
Conversation
Greptile SummaryThis PR adds rendering support for human replay evaluations with configurable intervals and map selection. It also fixes a bug where static agents weren't being marked as experts in Key changes:
Issues found:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[PuffeRL.evaluate] -->|Check eval_render_enabled| B{Enabled & at interval?}
B -->|Yes| C[Find latest checkpoint]
B -->|No| Z[Skip]
C --> D[Export model to .bin]
D --> E{render_async?}
E -->|Yes| F[Start multiprocessing.Process]
E -->|No| G[Call render_eval_videos directly]
F --> H[render_eval_videos runs in background]
G --> I[render_eval_videos runs synchronously]
H --> J[Put results in render_queue]
I --> K[Log to wandb immediately]
J --> L[check_render_queue polls queue]
L --> M[Log to wandb with eval_render namespace]
N[render_eval_videos] --> O[Select random maps from map_dir]
O --> P[Build command with --control-mode override]
P --> Q[Call ./visualize for each map]
Q --> R[Generate topdown & agent videos]
R --> S[Move videos to eval_videos dir]
Last reviewed commit: b329856 |
pufferlib/ocean/drive/visualize.c
Outdated
|
|
||
| Weights *weights = load_weights(policy_name); | ||
| printf("Active agents in map: %d\n", env.active_agent_count); | ||
| printf("Static expoer agents in the map :%d\n", env.expert_static_agent_count); |
There was a problem hiding this comment.
Typo: 'expoer' should be 'expert'
Suggested change
| printf("Static expoer agents in the map :%d\n", env.expert_static_agent_count); | |
| printf("Static expert agents in the map: %d\n", env.expert_static_agent_count); |
pufferlib/pufferl.py
Outdated
| cmd.append("--lasers") | ||
| if render_configs.get("show_human_logs", False): | ||
| cmd.append("--show-human-logs") | ||
| base_cmd.append("--log-trajectories") |
There was a problem hiding this comment.
Appending to base_cmd instead of cmd - flag won't be included in the command that gets executed. Other flags correctly append to cmd.
Suggested change
| base_cmd.append("--log-trajectories") | |
| cmd.append("--log-trajectories") |
pufferlib/ocean/drive/visualize.c
Outdated
| .map_name = (char *)map_name, | ||
| }; | ||
|
|
||
| printf("Control Mode : %.2d", control_mode_int); |
There was a problem hiding this comment.
Missing newline character in printf
Suggested change
| printf("Control Mode : %.2d", control_mode_int); | |
| printf("Control Mode: %d\n", control_mode_int); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR augments rendering support for evals. We can now specify an
eval_render_interval, along with number of maps and amap_dirto run visualizations on.This also fixes some issues with static agents (previously - static agents were not marked as experts while the mode was set to
control_sdc_only)