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

The code cannot run normally on M1 Mac. Please help me, thank you #176

Open
zdw19840929 opened this issue Mar 15, 2023 · 8 comments
Open

Comments

@zdw19840929
Copy link

I executed this code on the mac of M1

from stable_diffusion_videos import StableDiffusionWalkPipeline, Interface
import torch

pipeline = StableDiffusionWalkPipeline.from_pretrained(
    "CompVis/stable-diffusion-v1-4",
    torch_dtype=torch.float32,
    revision="fp16",
).to("mps")

interface = Interface(pipeline)
interface.launch()

and then reported the following error after clicking submit in the browser. I don't know how to modify it.
截屏2023-03-15 13 46 30

@nateraw
Copy link
Owner

nateraw commented Mar 16, 2023

Remove revision='fp16' and try again

@zdw19840929
Copy link
Author

Thank you for your reply
I removed revision='fp16 'and reported the following error
截屏2023-03-21 13 33 49

@naokikano
Copy link

Is it possible to run this on a M1 mac? Otherwise I can skip the paid resources!!

@quintendewilde
Copy link

I get this error when running

Cannot initialize model with low cpu memory usage because `accelerate` was not found in the environment. Defaulting to `low_cpu_mem_usage=False`. It is strongly recommended to install `accelerate` for faster and less memory-intense model loading. You can do so with: 

pip install accelerate

.
`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["id2label"]` will be overriden.
Traceback (most recent call last):
  File "/Users/quintendewilde/test.py", line 4, in <module>
    pipeline = StableDiffusionWalkPipeline.from_pretrained(
  File "/Users/quintendewilde/Library/Python/3.9/lib/python/site-packages/diffusers/pipeline_utils.py", line 270, in to
    module.to(torch_device)
  File "/Users/quintendewilde/Library/Python/3.9/lib/python/site-packages/torch/nn/modules/module.py", line 1145, in to
    return self._apply(convert)
  File "/Users/quintendewilde/Library/Python/3.9/lib/python/site-packages/torch/nn/modules/module.py", line 797, in _apply
    module._apply(fn)
  File "/Users/quintendewilde/Library/Python/3.9/lib/python/site-packages/torch/nn/modules/module.py", line 820, in _apply
    param_applied = fn(param)
  File "/Users/quintendewilde/Library/Python/3.9/lib/python/site-packages/torch/nn/modules/module.py", line 1143, in convert
    return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
  File "/Users/quintendewilde/Library/Python/3.9/lib/python/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

@quintendewilde
Copy link

@nateraw you have any idea?

@nateraw
Copy link
Owner

nateraw commented May 15, 2023

I do not have a M1 machine so I have no way of debugging/reproducing any issues here or fixing them :(. If someone with an M1 wants to help, it would be much appreciated.

@quintendewilde The first part of your message is just a warning, afaik. The second part looks like something was trying to get set to a cuda device, which would fail on M1. Did you run similar code as OP? If not, please send what you were running.

@dnztsdzn
Copy link

this one is working for me

pipeline = StableDiffusionWalkPipeline.from_pretrained(
"CompVis/stable-diffusion-v1-4",
torch_dtype=torch.float32,
)

@quintendewilde
Copy link

@dnztsdzn Thanks it works for me too. I still get the black images because it thinks it's creating things that are "not allowed". Can I do something about this @nateraw

Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants