Fix AttributeError in diffusion_dpo --loss_type ipo#13522
Open
Ricardo-M-L wants to merge 1 commit intohuggingface:mainfrom
Open
Fix AttributeError in diffusion_dpo --loss_type ipo#13522Ricardo-M-L wants to merge 1 commit intohuggingface:mainfrom
Ricardo-M-L wants to merge 1 commit intohuggingface:mainfrom
Conversation
The IPO branch in `train_diffusion_dpo.py` references `args.beta`, but
this script only defines `--beta_dpo` — there is no `--beta` argument.
Running training with `--loss_type ipo` crashes immediately at the loss
computation with:
AttributeError: 'Namespace' object has no attribute 'beta'
The `sigmoid` and `hinge` branches right above correctly use
`args.beta_dpo`, so IPO was clearly meant to use the same hyperparameter.
Swap to `args.beta_dpo` to unbreak `--loss_type ipo`.
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?
Fixes an
AttributeErrorinexamples/research_projects/diffusion_dpo/train_diffusion_dpo.pythat crashes the IPO loss path.The IPO branch references
args.beta:but this script only exposes
--beta_dpo:So running with
--loss_type ipocrashes immediately with:The
sigmoidandhingebranches above correctly useargs.beta_dpo, and the SDXL siblingtrain_diffusion_dpo_sdxl.pyalso only usesargs.beta_dpo. This was clearly intended to use the same hyperparameter.Fix
Before submitting
Who can review?
@sayakpaul