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

ImportError: DLL load failed while importing inplace_abn: #1

Open
toyxyz opened this issue Jul 30, 2024 · 4 comments
Open

ImportError: DLL load failed while importing inplace_abn: #1

toyxyz opened this issue Jul 30, 2024 · 4 comments

Comments

@toyxyz
Copy link

toyxyz commented Jul 30, 2024

Thanks for the nice work!

I installed the node, put Detectron2 and DensePose in the site-packages, but got the following error

C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py:1967: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
warnings.warn(
Traceback (most recent call last):
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\nodes.py", line 1931, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 940, in exec_module
File "", line 241, in call_with_frames_removed
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\Comfyui-CatVTON_init
.py", line 3, in
from .model.cloth_masker import AutoMasker as AM
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\Comfyui-CatVTON\model\cloth_masker.py", line 9, in
from ..model.SCHP import SCHP # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\Comfyui-CatVTON\model\SCHP_init_.py", line 1, in
from . import networks
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\Comfyui-CatVTON\model\SCHP\networks_init_.py", line 3, in
from .AugmentCE2P import resnet101
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\Comfyui-CatVTON\model\SCHP\networks\AugmentCE2P.py", line 21, in
from ..modules import InPlaceABNSync
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\Comfyui-CatVTON\model\SCHP\modules_init_.py", line 1, in
from .bn import ABN, InPlaceABN, InPlaceABNSync
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\Comfyui-CatVTON\model\SCHP\modules\bn.py", line 10, in
from .functions import *
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\Comfyui-CatVTON\model\SCHP\modules\functions.py", line 10, in
_backend = load(name="inplace_abn",
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1309, in load
return _jit_compile(
^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1745, in _jit_compile
return _import_module_from_library(name, build_directory, is_python_module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 2143, in _import_module_from_library
module = importlib.util.module_from_spec(spec)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing inplace_abn:The specified module could not be found

@pzc163
Copy link
Owner

pzc163 commented Jul 30, 2024

First,type pip install to check if detectron2 and detectron2-densepose==0.6 has been installed successfully under your Comfyui python environment. as below pic shown
image
If not ,pls manually install detectron2 and densepose with below cli:
pip install git+https://github.com/facebookresearch/detectron2.git@v0.6
pip install git+https://github.com/facebookresearch/detectron2.git@v0.6#subdirectory=projects/DensePose
notice that before install detectron2 and densepose you need to install VS2019 and add VS2019 to your system environment variables path

@toyxyz
Copy link
Author

toyxyz commented Jul 30, 2024

Thanks! I installed dectron2 and densepose manually, but this time I got a new error.

image

C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py:1967: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
warnings.warn(
Traceback (most recent call last):
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\nodes.py", line 1931, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 940, in exec_module
File "", line 241, in call_with_frames_removed
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\Comfyui-CatVTON_init
.py", line 3, in
from .model.cloth_masker import AutoMasker as AM
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\Comfyui-CatVTON\model\cloth_masker.py", line 10, in
from ..model.DensePose import DensePose # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\Comfyui-CatVTON\model\DensePose_init_.py", line 12, in
from densepose import add_densepose_config
File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\densepose_init_.py", line 2, in from .data.datasets import builtin # just to register data
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\densepose\data_init_.py", line 4, in
from .build import (
File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\densepose\data\build.py", line 13, in
from detectron2.data.build import build_detection_test_loader as d2_build_detection_test_loader
File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\detectron2\data_init_.py", line 2, in
from . import transforms # isort:skip
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\detectron2\data\transforms_init_.py", line 4, in
from .transform import *
File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\detectron2\data\transforms\transform.py", line 36, in
class ExtentTransform(Transform):
File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\detectron2\data\transforms\transform.py", line 46, in ExtentTransform
def init(self, src_rect, output_size, interp=Image.LINEAR, fill=0):
^^^^^^^^^^^^
AttributeError: module 'PIL.Image' has no attribute 'LINEAR'

@toyxyz
Copy link
Author

toyxyz commented Jul 30, 2024

I downgraded the pillow version to 9.5.0 and it works.

facebookresearch/detectron2#5010 (comment)

@ycyy
Copy link

ycyy commented Aug 2, 2024

I downgraded the pillow version to 9.5.0 and it works.我将枕头版本降级到 9.5.0,它可以工作。

facebookresearch/detectron2#5010 (comment)
change “detectron2\data\transforms\transform.py, line 46” from LINEAR to BILINEAR

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

3 participants