Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"RuntimeError: Found dtype Half but expected Float" when trying to train unconditional_image_generation using `--mixed_precision=fp16' #5274

Closed
linhduongtuan opened this issue Oct 3, 2023 · 3 comments · Fixed by #5407
Assignees
Labels
bug Something isn't working

Comments

@linhduongtuan
Copy link

linhduongtuan commented Oct 3, 2023

Describe the bug

"RuntimeError: Found dtype Half but expected Float" when trying to train unconditional_image_generation using `--mixed_precision=fp16'

But it works if I set --mixed_precision=no

Reproduction

interactive --gpus=4 -t 2:20:00
accelerate config defaults

accelerate launch --mixed_precision="fp16" --multi_gpu train_unconditional.py
--dataset_name="huggan/flowers-102-categories"
--resolution=64 --center_crop --random_flip
--output_dir="ddpm-ema-flowers-64"
--train_batch_size=16
--num_epochs=100
--gradient_accumulation_steps=1
--use_ema
--learning_rate=1e-4
--lr_warmup_steps=500
--mixed_precision="fp16"
--prediction_type="epsilon"
--logger="wandb"

Logs

No response

System Info

Ubuntu 20.4
Pytorch 2.0.1
Diffusers 0.22
Transformers 4.33
Accelerate 0.23
GPUs A100

Who can help?

@sayakpaul
I encounter with this error "RuntimeError: Found dtype Half but expected Float" when trying to train unconditional_image_generation using `--mixed_precision=fp16'

But it works if I set --mixed_precision=no
Here is my tracebacks
Untitled

Thank in advance,
Linh

@linhduongtuan linhduongtuan added the bug Something isn't working label Oct 3, 2023
@linhduongtuan
Copy link
Author

Hi @sayakpaul
I hope this report finds you well. Would you be able to take a look into my bug report and help me?
Linh

@sayakpaul
Copy link
Member

Hi @linhduongtuan.

#5407 should fix it.

@linhduongtuan
Copy link
Author

Hi @sayakpaul
Thank you so much for supporting.
Linh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants