-
Notifications
You must be signed in to change notification settings - Fork 615
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
no model named 'torch' #740
Comments
You should install torch before installing xFormers. |
I already had torch, I needed it to install stable diffusion. |
I think the problem is that This is problematic when installing all the dependencies of a project from scratch in an environment. All the dependencies are resolved properly and torch is also going to be installed... but previously, the The workaround I found is to install the torch dependency in advance. For example: pip install torch
pip install -r requirements. txt |
Thank you, I'll give that a try after work :) |
I am also getting this issue, and am unsure how to solve it. I am adding this package inside a |
Same issue for me, |
I'm hitting this issue with poetry on macOS. |
a trick way is to install torch correctly, you make sure yourself. |
Yep, installing pytorch from source and then |
@jinmingyi1998 do I understand correctly that the suggested workaround requires not putting xformers in my Am I understanding correctly that xformers is expressly choosing to disregard the recommendation against "building packages in the destination environment" mentioned in this comment? |
That's definitely not a good situation, but we couldn't find a satisfying solution. The problem with not building in the destination environment is that you might end up building xFormers with a different version of Pytorch than the one in your environment, which will break everything. |
Yes, I saw that discussion. Is it possible to provide some pre-built wheels that build in that relationship? E.g. I could declare a dependency on |
You can also use the pypi wheels which are already built: |
Hmm, maybe I missed something. The issue above happens when you use
will crash on
I'm using
|
Also running into this issue. My pip requirements file has these versions:
and I am running in a venv with py3.10. It looks to me that either 1) xformers is uninstalling torch before its own install or 2) xformers install is ignoring venv paths and installing on the machine natively (and so it does not see an installed torch dependency). I tried
|
I see that there are no prebuilt binaries for MacOS in PyPI, which would explain why it tries to build locally. |
xformers is not compatible with MacOS |
@danthe3rd Facebook should put that in the README in the install instructions. Would save so many of us wasted time. (Sure it says, "Recommended, Windows & Linux", but that's much less clear than actually saying "Does not work on Mac") |
HuggingFace complains that xformers is not available. I know that's HF's fault (or maybe torch?), but it's annoying that I can't silence the warning or that the warning exists at all. I'll figure out where the warning is coming from and file an issue there. |
I am getting the same issue, I have a Mac M1 Pro chip. I ensured that pytorch is installed before trying to install xformers.
I still get the same error:
I tried the following options:
I still get the exact same error as shown above. |
I completely forgot I started this question my bad... I ended up downloading the "A1111 WebUI Easy Installer and Launcher". It will install all dependencies and everything you need and has an option to install x-formers. Worked like a charm. |
getting same on linux with torch 2.0.1 |
this thread is cursed |
I'm not sure if it's correct way of handling things, but correcting this string to '==0.0.20' fixes xformers install for me - and maybe for others too. Please see this thread, this is the issue I had (trying to install InvokeAI): facebookresearch/xformers#740
Here is my solution in my environment:
But I already installed torch, so I followed the suggestions in this issue, I tried --no-dependencies and --pre -U, unfortunately nothing works.
I installed ninja
I searched the error, and it is said it's a problem of gcc in aarch64, and will be fixed in gcc-8.4.1-1
|
Also struggling with this issue now on macOS M1. Is there any reasonable work around? Would want to avoid running in Docker Desktop when debugging unit tests. |
The real solution. Many thanks. |
Thanks for the explanation! In my case (Apple M1, MacOS 13.6.4), after installing
and it installed. |
None of the provided solutions are working! Any straight way solution that works on ubuntu ec2 instance? |
Tried everything and doing things in this order worked for me (windows 11) :)) |
The issue still persists. Windows 10 // Torch 2.2.2 EDIT: Adding the pip flag |
thanks |
@HuabeiYou How to find CC and CXX path ? |
From my (very limited) understanding, the clang error was thrown because MacOS's default C compiler doesn't support some required options for compiling certain dependencies. To resolve this, we need to use an alternative compiler like gcc.
After installation, you can typically find the GCC and G++ compilers under |
Work for me . Just use |
it worked for me (macos intel) |
FYI had the same issue on Ubuntu 24.04 with Python 3.12, and this trick did the install without issues:
|
Hi, how can I install gcc on windows? thanks!! |
fixed it for me |
worked to me |
pip install ninja wheel setuptools worked to me. |
For me a solution was to install torch independently prior to installation. Now I use MacBook with M3 (os Sonoma) - the workaround was to install |
this works for me. Thank you. |
Couldn't this project simply add a [build-system]
requires = ["setuptools", "torch"]
build-backend = "setuptools.build_meta" |
same. turns out my system don't have wheel installed |
TL;DR try See issue python-poetry/poetry#9707 |
Windows 11 Solution
But pay close attention to the build errors, they should tell you whether it wants gcc or another compiler. |
Similar issue(s) trying to install xformers on a mac studio m1 max in a conda venv. After many attempts and different errors, this was the solution for me:
Notes:
Now I've this warning
Which is normal I guess :) EDIT: in the end, I removed xformers because it was causing issues with some ComfyUI workflows
Too bad... 😟 |
had similar issues with torch and SentenceTransformer. solved creating a separated virtualenv just installing torch and SentenceTransformer before anything else. |
I'm really not used to using command prompt and I'm guessing this is an issue with torch but i even reinstalled it and im still getting this error. Any ideas?
(I know the absolute bare minimum about this stuff. So, please talk to me like I'm an idiot, lol)
The text was updated successfully, but these errors were encountered: