Open mooseknuckleking opened 1 year ago
Strange! Sounds like numpy wasn't installed properly...but then you tried to reinstall it and it was. Have you tried reinstalling MetalDiffusion enitrely?
I'm also running into this! See https://github.com/soten355/MetalDiffusion/discussions/11 Did you manage to resolve it @mooseknuckleking ?
I feel like the Virtual Python Environment "venv" that we're running MetalDiffusion inside (if following your instructions @soten355 ) should not be looking in:
Creating a virtual environment for Python using: python -m venv venv
and activating source venv/bin/activate
and installing dependencies pip install -r requirements.txt --no-cache-dir
actually seems to install:
(a) scripts into a "bin" folder inside the "venv" directory:
/Users/
and the dependency "site-packages" into a "lib" folder inside the "venv" directory:
/Users/
│ │ argparse = <module 'argparse' from │ │ │ │ '/Library/Developer/CommandLineTools/Library/Frameworks/Pyth… │ │ │ │ box = <module 'rich.box' from │ │ │ │ '/Users/username/Library/Python/3.9/lib/python/site-pac… │ │ │ │ gc = <module 'gc' (built-in)> │ │ │ │ install = <function install at 0x10b5e2ca0> │ │ │ │ os = <module 'os' from │ │ │ │ '/Library/Developer/CommandLineTools/Library/Frameworks/Pyth… │ │ │ │ Panel = <class 'rich.panel.Panel'> │ │ │ │ print = <function print at 0x10af85af0> │ │ │ │ random = <module 'random' from │ │ │ │ '/Library/Developer/CommandLineTools/Library/Frameworks/Pyth… │ │ │ │ Text = <class 'rich.text.Text'> │ │ │ │ time = <module 'time' (built-in)> │ │
it's trying to find the modules in the Xcode CommandLineTools folder!
/Library/Developer/CommandLineTools/Library/Frameworks/....
and
/Users/username/Library/Python/3.9/lib/python/....
@soten355 - I think you've missed a step in your installation instructions - somehow the venv environment we're using for MetalDiffusion needs to be configured to look in the correct location for modules/frameworks/etc. It seems like dream.py is looking in unpredictable locations based on how the user has their MacOS Python installation(??) configured (which shouldn't matter if you're directing us to run MetalDiffusion within a Python venv inside the MetalDiffusion folder, right?).
Where/how can we SET the configuration paths for MetalDiffusion correctly?
@raffetazarius This is so strange! The reason I designed the installation around virtual environments is to avoid just this.
When using a virtual environment, it will install the library dependencies into the /venv/lib/python3.9/site-packages. This keeps the virtual environment independent of the global environment.
Are you running MetalDiffusion in the virtual environment? For example:
source venv/bin/activate
python dream.py
@raffetazarius This is so strange! The reason I designed the installation around virtual environments is to avoid just this.
When using a virtual environment, it will install the library dependencies into the /venv/lib/python3.9/site-packages. This keeps the virtual environment independent of the global environment.
Are you running MetalDiffusion in the virtual environment? For example:
source venv/bin/activate python dream.py
Yes, I was running it in the virtual environment.
It seems that my system was looking in non-venv locations for Python though. I did a big cleanup of all the Python versions I had installed on my machine though, but I also decided to remove MetalDiffusion and just focus on getting A1111 up and running on my rig. I'll update this thread if I decide to test out MetalDiffusion again.
Do you leverage tensorflow-metal in MetalDiffusion? https://developer.apple.com/metal/tensorflow-plugin/
Hmmm, you might be missing a step during installation or did something extra on accident. When running a code in a virtual environment, it will only reference the libraries in the environment; it's kind of a basic Python method.
Yes, MetalDiffusion utiliizes TensforFlow as a render framework. To use it, go to Advanced Settings and select TensorFlow as the render framework. Couple notes:
It will use the GPU
It will not use Diffusers models, but it WILL use safetenors and ckpt's
It does not currently support SDXL or LoRA's (either XL or not)
If you have any other questions regarding TensorFlow, please open a new issue. For now, let's keep this convo strictly about library dependencies in a virtual environment.
Not recognizing numpy?