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

Tried to run diffusers/stable_diffusion.ipynb on Mac M3 and ran into errors #9967

Closed
chrismattmann opened this issue Nov 20, 2024 · 9 comments
Labels
bug Something isn't working stale Issues that haven't received updates

Comments

@chrismattmann
Copy link

Describe the bug

I tried to run diffusers/stable_diffusion.ipynb on Mac M3 and it failed in several parts, including:

  • nvidia-smi call doesn't work
  • wasn't able to download the torch models due to some weird issues like ImportError: cannot import name 'DIFFUSERS_SLOW_IMPORT' from 'diffusers.utils' due to conflicting libraries
  • cuda calls needed to be replaced with mps device

I went ahead and updated the notebook and have a PR I could submit if interested that fixes it. I just made a copy of the notebook and added _macosx.ipynb to it. I realize some fancier way could have been to try some if/else guess system types in the notebook else, but I just opted for fixing it separately.

Reproduction

Tried on a brand new Mac M3

Logs

Don't really have logs

System Info

Brand new Mac M3 Max running Sonoma 14.6

Who can help?

No response

@chrismattmann chrismattmann added the bug Something isn't working label Nov 20, 2024
@chrismattmann
Copy link
Author

Very excited b/c I fixed it! It works locally perfectly now! Love the image generation and thank you for your work. Let me know if you'd like the PR!

@sayakpaul
Copy link
Member

Of course, please feel free PR it :) Thank you! Cc: @pcuenca

@chrismattmann
Copy link
Author

excellent @sayakpaul i will prepare and submit today!

@chrismattmann
Copy link
Author

Added PR in huggingface/notebooks#533

@chrismattmann
Copy link
Author

@sayakpaul @pcuenca

@pcuenca
Copy link
Member

pcuenca commented Nov 23, 2024

wasn't able to download the torch models due to some weird issues

How did you fix this?

@chrismattmann
Copy link
Author

wasn't able to download the torch models due to some weird issues

How did you fix this?

@pcuenca the fix was this line:

  if isosx:
   # This is added to get around some issues of Torch not loading models correctly on Mac OS X
   !pip install --upgrade huggingface-hub==0.26.2 transformers==4.46.1 tokenizers==0.20.1 diffusers==0.31.0

I Googled around and found someone saying that you need these versions of those libraries to make it work on Mac OSX and this worked for me.

Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Dec 20, 2024
@chrismattmann
Copy link
Author

fixed in #533

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Issues that haven't received updates
Projects
None yet
Development

No branches or pull requests

3 participants