Fix dataset-not-detected and mouse-recording training crash#67
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3319ba11c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # vector (29 keyboard+gamepad, or 39 when mouse recording is on). | ||
| # A positive --num-actions overrides it for advanced use. This fixes | ||
| # the "Target size ... must be the same as input size" crash (#64). | ||
| num_actions = args.num_actions if args.num_actions > 0 else dataset.num_actions |
There was a problem hiding this comment.
Persist the auto-detected action width
When this auto-detects 39 actions for a mouse-recorded dataset, training can now finish but the saved checkpoints still do not record that width; models_pytorch.load_model() defaults num_actions back to 29, and 3-test_model.py calls it without an override, so loading the resulting 39-output state dict fails with size mismatches before inference can run. Please save num_actions as checkpoint metadata and have the loader use it, otherwise every mouse-enabled model produced by this path is unusable by the bundled tester.
Useful? React with 👍 / 👎.
Fix dataset-not-detected and mouse-recording training crash
1-collect_data.py: honor the --out argument the Tauri shell passes so
recordings land in datasets/// where the Train-tab scanner
looks. The legacy collector had no argparse and silently ignored --out,
writing to a bare datasets/ folder that never appeared in the UI
(issues BOT MMORPG AI v0.2.1 #57, Dataset not appearing after recording #60, Dataset not appearing after recording even after latest fix #63, bot erorr #65).
2-train_model.py: auto-detect the model output-head size from the
dataset's action vector (29 keyboard+gamepad, or 39 when mouse
recording adds 10 values) and default --num-actions to 0 (auto). Fixes
the BCEWithLogitsLoss 'Target size must be the same as input size'
crash (issue Debug Bundle for R F MMORPG Online #64).
Document both fixes in docs/installer/04-bug-index.md and CHANGELOG.md.