TMElyralab / Comfyui-MusePose

Other
291 stars 29 forks source link

Problem: name 'init_detector' is not defined #2

Open Affegithub opened 1 month ago

Affegithub commented 1 month ago

Hi, thanks for structuring new nodes, but I got a below error during it runs "muse_pose_allign". Hope you can give me an advise to solve this error. Error description was as follows:

Error occurred when executing museposealign:

name 'init_detector' is not defined

File "C:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "C:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "C:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "C:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose\nodes.py", line 554, in posealign_func return run_align_video_with_filterPose_translate_smooth(args) File "C:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose\nodes.py", line 276, in run_align_video_with_filterPose_translate_smooth detector = DWposeDetector( File "C:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose\pose\script\dwpose.py", line 74, in init self.pose_estimation = Wholebody(det_config, det_ckpt, pose_config, pose_ckpt, device) File "C:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose\pose\script\wholebody.py", line 51, in init self.detector = init_detector(det_config, det_ckpt, device=device)

mrkennypowers commented 1 month ago

I'm having the same issue.

lulu-xiao commented 1 month ago

Hi, thanks for structuring new nodes, but I got a below error during it runs "muse_pose_allign". Hope you can give me an advise to solve this error. Error description was as follows:

Error occurred when executing museposealign:

name 'init_detector' is not defined

File "C:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "C:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "C:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) File "C:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose\nodes.py", line 554, in posealign_func return run_align_video_with_filterPose_translate_smooth(args) File "C:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose\nodes.py", line 276, in run_align_video_with_filterPose_translate_smooth detector = DWposeDetector( File "C:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose\pose\script\dwpose.py", line 74, in init self.pose_estimation = Wholebody(det_config, det_ckpt, pose_config, pose_ckpt, device) File "C:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose\pose\script\wholebody.py", line 51, in init** self.detector = init_detector(det_config, det_ckpt, device=device)

Has mmdet been successfully installed?

企业微信截图_94722a4e-7e65-44dd-9f2d-775c6cea5b72
pondloso commented 1 month ago

I'm also had same error,try to re install "mmcv " "mmdet " "mmpose " still get same error.

meilongggg commented 1 month ago

same error for me too, please help us solve it as soon as possible

meilongggg commented 1 month ago

I checked that there indeed is mmdet in site packages in python embedded for comfyui, but it still doesn't work

Appolonius001 commented 1 month ago

same here name 'init_detector' is not defined

meilongggg commented 1 month ago

where should the mmdet file be located at?

SoaringTiger commented 1 month ago

same error

fusillustrator commented 1 month ago

same error

ioritree commented 1 month ago

same error

gstocker75 commented 1 month ago

same

ariyean commented 1 month ago

kindda similar error

Error occurred when executing museposealign:

name 'init_detector' is not defined

File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose\nodes.py", line 554, in posealign_func return run_align_video_with_filterPose_translate_smooth(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose\nodes.py", line 276, in run_align_video_with_filterPose_translate_smooth detector = DWposeDetector( ^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose\pose\script\dwpose.py", line 74, in init self.pose_estimation = Wholebody(det_config, det_ckpt, pose_config, pose_ckpt, device) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose\pose\script\wholebody.py", line 51, in init self.detector = init_detector(det_config, det_ckpt, device=device) ^^^^^^^^^^^^^

Close

ManuelMultiverse commented 1 month ago

same error here

SirLatore commented 1 month ago

Same error for me also

czk32611 commented 1 month ago

This error means that mmcv, mmpose or mmdet is not installed correctly. Plz check them again.

meilongggg commented 1 month ago

This error means that mmcv, mmpose or mmdet is not installed correctly. Plz check them again.

how to install these for portable Comfyui ?

fusillustrator commented 1 month ago

This error means that mmcv, mmpose or mmdet is not installed correctly. Plz check them again.

how to install them?

chees-cn commented 1 month ago

!!! Exception during processing !!! Traceback (most recent call last): File "/root/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/root/ComfyUI/execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "/root/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "/root/ComfyUI/custom_nodes/Comfyui-MusePose/nodes.py", line 554, in posealign_func return run_align_video_with_filterPose_translate_smooth(args) File "/root/ComfyUI/custom_nodes/Comfyui-MusePose/nodes.py", line 276, in run_align_video_with_filterPose_translate_smooth detector = DWposeDetector( File "/root/ComfyUI/custom_nodes/Comfyui-MusePose/pose/script/dwpose.py", line 74, in init self.pose_estimation = Wholebody(det_config, det_ckpt, pose_config, pose_ckpt, device) File "/root/ComfyUI/custom_nodes/Comfyui-MusePose/pose/script/wholebody.py", line 51, in init self.detector = init_detector(det_config, det_ckpt, device=device) NameError: name 'init_detector' is not defined

SirLatore commented 1 month ago

the installation of all mmcv , mmpose and mmdet was sucessful just as instructed in the readme file .

here is the error message :

Error occurred when executing museposealign:

name 'init_detector' is not defined

File "C:\Local\AI\Comfy\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "C:\Local\AI\Comfy\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "C:\Local\AI\Comfy\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "C:\Local\AI\Comfy\ComfyUI\custom_nodes\Comfyui-MusePose\nodes.py", line 554, in posealign_func return run_align_video_with_filterPose_translate_smooth(args) File "C:\Local\AI\Comfy\ComfyUI\custom_nodes\Comfyui-MusePose\nodes.py", line 276, in run_align_video_with_filterPose_translate_smooth detector = DWposeDetector( File "C:\Local\AI\Comfy\ComfyUI\custom_nodes\Comfyui-MusePose\pose\script\dwpose.py", line 74, in init self.pose_estimation = Wholebody(det_config, det_ckpt, pose_config, pose_ckpt, device) File "C:\Local\AI\Comfy\ComfyUI\custom_nodes\Comfyui-MusePose\pose\script\wholebody.py", line 51, in init self.detector = init_detector(det_config, det_ckpt, device=device)

rethink-studios commented 1 month ago

(same)

Error occurred when executing museposealign:

name 'init_detector' is not defined

File "D:\COMFYUI_BETA\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\COMFYUI_BETA\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\COMFYUI_BETA\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\COMFYUI_BETA\ComfyUI\custom_nodes\Comfyui-MusePose\nodes.py", line 554, in posealign_func return run_align_video_with_filterPose_translate_smooth(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\COMFYUI_BETA\ComfyUI\custom_nodes\Comfyui-MusePose\nodes.py", line 276, in run_align_video_with_filterPose_translate_smooth detector = DWposeDetector( ^^^^^^^^^^^^^^^ File "D:\COMFYUI_BETA\ComfyUI\custom_nodes\Comfyui-MusePose\pose\script\dwpose.py", line 74, in init self.pose_estimation = Wholebody(det_config, det_ckpt, pose_config, pose_ckpt, device) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\COMFYUI_BETA\ComfyUI\custom_nodes\Comfyui-MusePose\pose\script\wholebody.py", line 51, in init self.detector = init_detector(det_config, det_ckpt, device=device) ^^^^^^^^^^^^^

gstocker75 commented 1 month ago

ok i got it working. pain in the ass big time.

this is my setup. for portable comfyui on windows 11. so no guarantee if you don't match

** Platform: Windows
** Python version: 3.11.8 (tags/v3.11.8:db85d51, Feb  6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)]
** Python executable: D:\AI\2024ComfyUI_windows_portable\python_embeded\python.exe

Total VRAM 24564 MB, total RAM 65382 MB
pytorch version: 2.3.0+cu121
xformers version: 0.0.26.post1
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 4090 : cudaMallocAsync
VAE dtype: torch.bfloat16
Using xformers cross attention

assuming you just used powershell or terminal to install things as i did... first you need to go to your musepose dir under comfy ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose git pull i picked up a couple updated files tonight. pip uninstall and or mim uninstall all the mm requirements from powershell or terminal or whatever mim UNINSTALL mmengine mim UNINSTALL mmcv mim UNINSTALL mmdet mim UNINSTALL mmpose

now install the mm requirements into your embedded python env. ..\..\..\python_embeded\python.exe -s -m mim install mmengine

this is a compiled version of mmcv and avoids the building wheel issues... ..\..\..\python_embeded\python.exe -s -m mim install --no-cache-dir mmcv==2.2.0 -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html

..\..\..\python_embeded\python.exe -s -m mim install --no-cache-dir "mmdet>=3.1.0"

..\..\..\python_embeded\python.exe -s -m mim install --no-cache-dir "mmpose==1.3.1"

you may get some errors like mmcv is at version blah blah but mmpose or mmdet requires version blah blah just look at the last entry of the error with the path to the__init__.py file and go update the <= as needed in those files or just up the maxversion number and save the files.

restart comfy, you should be good.

fusillustrator commented 1 month ago

ok i got it working. pain in the ass big time.

this is my setup. for portable comfyui on windows 11. so no guarantee if you don't match

** Platform: Windows
** Python version: 3.11.8 (tags/v3.11.8:db85d51, Feb  6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)]
** Python executable: D:\AI\2024ComfyUI_windows_portable\python_embeded\python.exe

Total VRAM 24564 MB, total RAM 65382 MB
pytorch version: 2.3.0+cu121
xformers version: 0.0.26.post1
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 4090 : cudaMallocAsync
VAE dtype: torch.bfloat16
Using xformers cross attention

assuming you just used powershell or terminal to install things as i did... first you need to go to your musepose dir under comfy ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose git pull i picked up a couple updated files tonight. pip uninstall and or mim uninstall all the mm requirements from powershell or terminal or whatever mim UNINSTALL mmengine mim UNINSTALL mmcv mim UNINSTALL mmdet mim UNINSTALL mmpose

now install the mm requirements into your embedded python env. ..\..\..\python_embeded\python.exe -s -m mim install mmengine

this is a compiled version of mmcv and avoids the building wheel issues... ..\..\..\python_embeded\python.exe -s -m mim install --no-cache-dir mmcv==2.2.0 -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html

..\..\..\python_embeded\python.exe -s -m mim install --no-cache-dir "mmdet>=3.1.0"

..\..\..\python_embeded\python.exe -s -m mim install --no-cache-dir "mmpose==1.3.1"

you may get some errors like mmcv is at version blah blah but mmpose or mmdet requires version blah blah just look at the last entry of the error with the path to the__init__.py file and go update the <= as needed in those files or just up the maxversion number and save the files.

restart comfy, you should be good.

what updated files?

gstocker75 commented 1 month ago

what updated files?

Comfyui-MusePose\pose\script\wholebody.py and something else i forget

fusillustrator commented 1 month ago

what updated files?

Comfyui-MusePose\pose\script\wholebody.py and something else i forget

what do you mean by install the mm requirements into your embedded python env.?

gstocker75 commented 1 month ago

what updated files?

Comfyui-MusePose\pose\script\wholebody.py and something else i forget

what do you mean by install the mm requirements into your embedded python env.?

copy and paste the new commands i provided that invoke python.exe into terminal or powershell or whatever you're using you need the full line ala ..\..\..\python_embeded\python.exe -s -m mim install mmengine

might need to do this first, so you have openmim ..\..\..\python_embeded\python.exe pip install --no-cache-dir -U openmim

fusillustrator commented 1 month ago

what updated files?

Comfyui-MusePose\pose\script\wholebody.py and something else i forget

what do you mean by install the mm requirements into your embedded python env.?

copy and paste the new commands i provided that invoke python.exe into terminal or powershell or whatever you're using you need the full line ala ..\..\..\python_embeded\python.exe -s -m mim install mmengine

might need to do this first, so you have openmim ..\..\..\python_embeded\python.exe pip install --no-cache-dir -U openmim

do i put that in the powershell of musepose?

fusillustrator commented 1 month ago

what updated files?

Comfyui-MusePose\pose\script\wholebody.py and something else i forget

what do you mean by install the mm requirements into your embedded python env.?

copy and paste the new commands i provided that invoke python.exe into terminal or powershell or whatever you're using you need the full line ala ..\..\..\python_embeded\python.exe -s -m mim install mmengine

might need to do this first, so you have openmim ..\..\..\python_embeded\python.exe pip install --no-cache-dir -U openmim

PS D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose> ......\python_embeded\python.exe pip install --no-cache-dir -U openmim D:\ComfyUI_windows_portable\python_embeded\python.exe: can't open file 'D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui-MusePose\pip': [Errno 2] No such file or directory

I dont understand

gstocker75 commented 1 month ago
powershell
fusillustrator commented 1 month ago

image

powershell

image

gstocker75 commented 1 month ago

oh your missing PIP try this python -m ensurepip --upgrade

fusillustrator commented 1 month ago

oh your missing PIP try this python -m ensurepip --upgrade

image

gstocker75 commented 1 month ago

make sure pip.exe is in here ComfyUI_windows_portable\python_embeded\Scripts make sure it's installed for all users. make sure

AppData\Local\Programs\Python\Python310\ 
AppData\Local\Programs\Python\Python310\Scripts\

are in your windows path.

i dunno beyond that. really outside the scope of this bug thread anyways

ManuelMultiverse commented 1 month ago

any solution for non-portable comfyUI install?

ioritree commented 1 month ago

ok i got it working. pain in the ass big time.

Total VRAM 24575 MB, total RAM 65469 MB
pytorch version: 2.3.0+cu121
xformers version: 0.0.26.post1
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync
VAE dtype: torch.bfloat16
Using xformers cross attention

......\python_embeded\python.exe -s -m mim install --no-cache-dir "mmdet>=3.1.0"

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for mmcv Running setup.py clean for mmcv Failed to build mmcv ERROR: Could not build wheels for mmcv, which is required to install pyproject.toml-based projects

fusillustrator commented 1 month ago

make sure pip.exe is in here ComfyUI_windows_portable\python_embeded\Scripts make sure it's installed for all users. make sure

AppData\Local\Programs\Python\Python310\ 
AppData\Local\Programs\Python\Python310\Scripts\

are in your windows path.

i dunno beyond that. really outside the scope of this bug thread anyways

how do you install python inside musepose? I am so confused

ManuelMultiverse commented 1 month ago

I already managed to install all of them, but having the same issue while running workflow: No module named mmcv PS C:\Users\manue\ComfyMuse\ComfyUI_windows_portable\ComfyUI\custom_nodes> mim list Package Version Source


mmcv 2.1.0 https://github.com/open-mmlab/mmcv mmdet 3.2.0 https://github.com/open-mmlab/mmdetection mmengine 0.10.4 https://github.com/open-mmlab/mmengine mmpose 1.3.1 https://github.com/open-mmlab/mmpose

SirLatore commented 1 month ago

even after the "pain in the ass" Process im getting this No module named 'mmcv'

Tophness commented 1 month ago

Solution @ #26

huiyichanmian commented 1 month ago

This problem still exists, problem: "NameError: name 'init_detector' is not defined". How did you solve it?