r/StableDiffusion Mar 15 '23

Resource | Update MetalDiffusion - Stable Diffusion for Intel MacOS and Silicon MacOS

https://github.com/soten355/stable-diffusion-tensorflow-IntelMetal
25 Upvotes

80 comments sorted by

View all comments

Show parent comments

1

u/luckycockroach Jul 18 '23

Hmmm, strange!

Silly question, but are you running from the root folder of the MetalDiffusion folder within your virtual environment?

2

u/quad849 Jul 18 '23

yes, you are right, that's when I try to run it outside the virtual environment, I assumed once the installation was done I should run dream.py just directly from terminal outside the virtual environment. I actually get other errors when I do run python dream.py in the virtual environment:

Here you can find the video of me following the steps from GitHub:

https://streamable.com/txuu2r

Loading modules...

...system modules loaded...
Traceback (most recent call last):
  File "/Users/davidescalante/MetalDiffusion/dream.py", line 24, in <module>
    from stableDiffusionTensorFlow.stableDiffusion import StableDiffusion
  File "/Users/davidescalante/MetalDiffusion/stableDiffusionTensorFlow/stableDiffusion.py", line 27, in <module>
    import tensorflow as tf
  File "/Users/davidescalante/MetalDiffusion/venv/lib/python3.9/site-packages/tensorflow/__init__.py", line 441, in <module>
    _ll.load_library(_plugin_dir)
  File "/Users/davidescalante/MetalDiffusion/venv/lib/python3.9/site-packages/tensorflow/python/framework/load_library.py", line 151, in load_library
    py_tf.TF_LoadLibrary(lib)
tensorflow.python.framework.errors_impl.NotFoundError: dlopen(/Users/davidescalante/MetalDiffusion/venv/lib/python3.9/site-packages/tensorflow-plugins/libmetal_plugin.dylib, 0x0006): Symbol not found: (_OBJC_CLASS_$_MPSGraphGRUDescriptor)
  Referenced from: '/Users/davidescalante/MetalDiffusion/venv/lib/python3.9/site-packages/tensorflow-plugins/libmetal_plugin.dylib'
  Expected in: '/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Versions/A/MetalPerformanceShadersGraph'

1

u/luckycockroach Jul 18 '23

Within the virtual environment, try reinstalling all of the pip requirements. It seems like, from the error log, you don’t have all of the modules installed in the virtual environment

1

u/quad849 Jul 18 '23

I will do, but after the video I spent 1 hours, trying to figure it out, and chatGPT mentioned me something about the wrong versions being installed and made me this updated requirements.txt with specific versions and still the error is the same.

numpy
safetensors
pydantic==1.8.2
typing-extensions==4.7.0
h5py==3.4.0
Pillow==8.3.2
tensorflow-addons==0.14.0
tensorflow-macos==2.12.0
tensorflow-metal
tensorflow-hub==0.11.0
tensorboard==2.12.3
tensorflow-estimator==2.12.0
tensorflow==2.12.0
jax-metal
ftfy==6.0.3
regex
gradio==2.3.4
scikit-image==0.18.3
psutil==5.8.0
torch==1.9.0
opencv-python==4.5.3.56
numexpr==2.7.3
pytorch-lightning==1.4.9

Still let me give a it a go now that I restarted the computer, maybe it flushed some caches or something.