diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

sampling bug fix in diffusers tutorial "basic_training.md"

Open yue-here opened this issue 1 year ago • 0 comments

What does this PR do?

In the diffusers basic training tutorial, setting the manual seed argument (generator=torch.manual_seed(config.seed)) in the pipeline call inside the evaluate() function rewinds the random state of the dataloader shuffling, leading to overfitting due to the model seeing same sequence of training examples after every evaluation call.

Using generator=torch.Generator(device='cpu').manual_seed(config.seed) avoids this.

Fixes # 7991

  • Docs: @stevhliu and @sayakpaul

yue-here avatar May 21 '24 21:05 yue-here