pzc163 / Comfyui-CatVTON

112 stars 9 forks source link

ImportError: DLL load failed while importing inplace_abn: #1

Open toyxyz opened 1 month ago

toyxyz commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

I downgraded the pillow version to 9.5.0 and it works.

https://github.com/facebookresearch/detectron2/issues/5010#issuecomment-1752284625

ycyy commented 1 month ago

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