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

pip install detectron2_densepose-0.6-py3-none-any.whl failed #7

Open
waaaok opened this issue Aug 1, 2024 · 4 comments
Open

pip install detectron2_densepose-0.6-py3-none-any.whl failed #7

waaaok opened this issue Aug 1, 2024 · 4 comments

Comments

@waaaok
Copy link

waaaok commented Aug 1, 2024

my python==3.11.9
i placed detectron2-0.6-cp311-cp311-win_amd64.whl and detectron2_densepose-0.6-py3-none-any.whl to ./ComfyUI/python/Lib/site-packages/
pip install detectron2-0.6-cp311-cp311-win_amd64.whl successfully installed
pip install detectron2_densepose-0.6-py3-none-any.whl failed

20240801120318

@madddmunky
Copy link

@waaaok facing the same issue, have you solved it?

@SohmP
Copy link

SohmP commented Jan 21, 2025

anyone got the solution ??

@Botoni
Copy link

Botoni commented Feb 1, 2025

Here is the solution:

The error occurs because the build process for detectron2 can't find PyTorch (torch) in its isolated environment, even though it's installed in your virtual environment. This is due to pip's default behavior of using build isolation, which creates a temporary environment without your installed packages. Here's how to fix it:

Ensure Torch is Installed: Verify that PyTorch is installed in your activated virtual environment:

pip show torch

Install detectron2 with Build Isolation Disabled: Use the --no-build-isolation flag to allow the build process to access your installed packages:

pip install git+https://github.com/facebookresearch/[email protected] --no-build-isolation

Same for:

git+https://github.com/facebookresearch/[email protected]#subdirectory=projects/DensePose

@Botoni
Copy link

Botoni commented Feb 1, 2025

You also need to patch the detectron2 because pillow changed some things.

Modify the detectron2 source code to use BILINEAR instead of LINEAR:

Open the file:

/path/to/venv/lib/python3.12/site-packages/detectron2/data/transforms/transform.py

Replace Image.LINEAR with Image.BILINEAR (line 46).

Save and restart ComfyUI.

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

4 participants