Not working on MacBook Pro M1 Max #1477
carlokarton
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I have tried many different options to make it work. Can anyone help me please ?
I have a Apple M1 Max 10 cores with 32 Go with 12.7.5 monterey
My instance images directory contains jpg photos with several sizes and weights (from 2500px up to 4000)
so here what I get when I have
Optimizer 8bit AdamW
Mixed Precision fp16 (no other choice)
Memory Attention : default
/Users/leonard/stable-diffusion-webui/modules/mac_specific.py:83: UserWarning: cumsum_out_mps supported by MPS on MacOS 13+, please upgrade (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/UnaryOps.mm:406.)
cumsum_needs_int_fix = not torch.Tensor([1,2]).to(torch.device("mps")).equal(torch.ShortTensor([1,1]).to(torch.device("mps")).cumsum(0))
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
then
To create a public link, set
share=True
inlaunch()
.Startup time: 13.3s (prepare environment: 9.3s, import torch: 1.5s, import gradio: 0.3s, setup paths: 0.5s, other imports: 0.3s, load scripts: 0.5s, create ui: 0.5s, gradio launch: 0.2s).
Advanced elements visible: False
Applying attention optimization: sub-quadratic... done.
Model loaded in 6.6s (create model: 0.8s, apply weights to model: 5.2s, apply float(): 0.2s).
Initializing dreambooth training...
WARNING:dreambooth.train_dreambooth:Wandb API key not set. Please set WANDB_API_KEY environment variable to use wandb.
Loading latent cache...
12 cached latents]
WARNING:dreambooth.optimization:Exception importing 8bit AdamW: No module named 'bitsandbytes'
Traceback (most recent call last):
File "/Users/leonard/stable-diffusion-webui/extensions/sd_dreambooth_extension/dreambooth/optimization.py", line 594, in get_optimizer
from bitsandbytes.optim import AdamW8bit
ModuleNotFoundError: No module named 'bitsandbytes'
No module named 'bitsandbytes'
WARNING: Using default optimizer (AdamW from Torch)
Init dataset!set: 0%| | 0/5 [00:00<?, ?it/s]
Preparing Dataset (With Caching)
Bucket 0 (384, 680, 0) - Instance Images: 1 | Class Images: 0 | Max Examples/batch: 1
Bucket 1 (440, 584, 0) - Instance Images: 11 | Class Images: 0 | Max Examples/batch: 11
Total Buckets 2 - Instance Images: 12 | Class Images: 0 | Max Examples/batch: 12
Total images / batch: 12, total examples: 12█| 12/12 [00:00<00:00, 28228.63it/s]
Initializing bucket counter!
Steps: 0%| | 0/1200 [00:00<?, ?it/s]Traceback (most recent call last):
File "/Users/leonard/stable-diffusion-webui/extensions/sd_dreambooth_extension/dreambooth/ui_functions.py", line 735, in start_training
result = main(class_gen_method=class_gen_method)
File "/Users/leonard/stable-diffusion-webui/extensions/sd_dreambooth_extension/dreambooth/train_dreambooth.py", line 2003, in main
return inner_loop()
File "/Users/leonard/stable-diffusion-webui/extensions/sd_dreambooth_extension/dreambooth/memory.py", line 126, in decorator
return function(batch_size, grad_size, prof, *args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/extensions/sd_dreambooth_extension/dreambooth/train_dreambooth.py", line 1745, in inner_loop
model_pred = unet(noisy_latents, timesteps, encoder_hidden_states).sample
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/accelerate/utils/operations.py", line 581, in forward
return model_forward(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/accelerate/utils/operations.py", line 569, in call
return convert_to_fp32(self.model_forward(*args, **kwargs))
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/amp/autocast_mode.py", line 16, in decorate_autocast
return func(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/diffusers/models/unets/unet_2d_condition.py", line 1216, in forward
sample, res_samples = downsample_block(
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/diffusers/models/unets/unet_2d_blocks.py", line 1269, in forward
hidden_states = attn(
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/diffusers/models/transformers/transformer_2d.py", line 385, in forward
hidden_states = torch.utils.checkpoint.checkpoint(
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_compile.py", line 24, in inner
return torch._dynamo.disable(fn, recursive)(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 328, in _fn
return fn(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/external_utils.py", line 17, in inner
return fn(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/utils/checkpoint.py", line 458, in checkpoint
ret = function(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/diffusers/models/transformers/transformer_2d.py", line 380, in custom_forward
return module(*inputs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/diffusers/models/attention.py", line 366, in forward
attn_output = self.attn2(
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/diffusers/models/attention_processor.py", line 522, in forward
return self.processor(
File "/Users/leonard/stable-diffusion-webui/venv/lib/python3.10/site-packages/diffusers/models/attention_processor.py", line 1279, in call
hidden_states = F.scaled_dot_product_attention(
RuntimeError: Expected query, key, and value to have the same dtype, but got query.dtype: c10::Half key.dtype: float and value.dtype: float instead.
Steps: 0%| | 0/1200 [00:00<?, ?it/s]
Duration: 00:00:11
Duration: 00:00:14
Beta Was this translation helpful? Give feedback.
All reactions