Fix AttributeError in onnxruntime train_unconditional (args.report_to → args.logger)#13524
Open
Ricardo-M-L wants to merge 1 commit intohuggingface:mainfrom
Open
Conversation
The ORT example `examples/research_projects/onnxruntime/unconditional_image_generation/train_unconditional.py` defines `--logger` (argparse line 196) but references `args.report_to` in two places: * Line 280: `if args.report_to == "wandb" and args.hub_token is not None:` * Line 294: `log_with=args.report_to,` Since there is no `--report_to` flag on the parser, both references crash with `AttributeError: 'Namespace' object has no attribute 'report_to'` as soon as `main()` starts — the script cannot run at all. The sibling non-ORT script `examples/unconditional_image_generation/train_unconditional.py` uses `args.logger` consistently; this PR aligns the ORT variant with that behavior, and updates the error message to refer to `--logger=wandb` instead of the non-existent `--report_to=wandb`.
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.
What does this PR do?
The ORT variant of the unconditional training script,
examples/research_projects/onnxruntime/unconditional_image_generation/train_unconditional.py,defines the tracker flag as
--loggeron the parser:…but
main()references a non-existentargs.report_totwice:Because no
--report_toflag is registered, theargsnamespace never carries that attribute, so both references raiseAttributeError: 'Namespace' object has no attribute 'report_to'at the very top ofmain(). The script can't run end-to-end.The sibling non-ORT script
examples/unconditional_image_generation/train_unconditional.pyusesargs.loggerthroughout. This PR aligns the ORT variant with that:args.report_to→args.loggerat both call sites--report_to=wandb→--logger=wandbin the error message textTrivial one-word fix; no behavior change beyond letting the script actually start.
Before submitting
Who can review?
@sayakpaul @stevhliu