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

[Bug]: xtcocotools build process is broken #1864

Closed
1 task done
rltgjqmcpgjadyd opened this issue Aug 4, 2023 · 11 comments
Closed
1 task done

[Bug]: xtcocotools build process is broken #1864

rltgjqmcpgjadyd opened this issue Aug 4, 2023 · 11 comments

Comments

@rltgjqmcpgjadyd
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

What happened?

Controlnet 397f54b

There is a process to build xtcocotools when start controlnet

But xtcocotools build process is broken

This makes it impossible for controlnet to run normally.

Here's the fix commit
jin-s13/xtcocoapi#34

Steps to reproduce the problem

  1. Update latest controlnet
  2. Launch WebUI

What should have happened?

Should start normally

Commit where the problem happens

webui: 45601766409e531d2b4ee512bf1433600f140183
controlnet: 397f54b

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--skip-python-version-check --xformers --xformers-flash-attention

List of enabled extensions

Disable all extensions except controlnet

Console logs

Building wheels for collected packages: xtcocotools
  Building wheel for xtcocotools (setup.py): started
  Building wheel for xtcocotools (setup.py): finished with status 'error'
  Running setup.py clean for xtcocotools
Failed to build xtcocotools



2023-08-05 07:14:36,265 - ControlNet - INFO - ControlNet v1.1.236
*** Error loading script: controlnet.py
    Traceback (most recent call last):
      File "J:\SDWebUI\modules\scripts.py", line 319, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 940, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "J:\SDWebUI\extensions\sd-webui-controlnet\scripts\controlnet.py", line 14, in <module>
        from scripts.controlnet_ui import controlnet_ui_group
      File "J:\SDWebUI\extensions\sd-webui-controlnet\scripts\controlnet_ui\controlnet_ui_group.py", line 22, in <module>
        from scripts.controlnet_ui.openpose_editor import OpenposeEditor
      File "J:\SDWebUI\extensions\sd-webui-controlnet\scripts\controlnet_ui\openpose_editor.py", line 6, in <module>
        from annotator.openpose import decode_json_as_poses, draw_poses
      File "J:\SDWebUI\extensions\sd-webui-controlnet\annotator\openpose\__init__.py", line 20, in <module>
        from .wholebody import Wholebody # DW Pose
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\extensions\sd-webui-controlnet\annotator\openpose\wholebody.py", line 3, in <module>
        from mmpose.apis import inference_topdown
    ModuleNotFoundError: No module named 'mmpose'

Additional information

No response

@huchenlei
Copy link
Collaborator

I am going to patch the feature behind a flag so that people with the build issue can just disable the feature, WDYT?

@AllInOneMighty
Copy link

Definitely happening to me after an update to ControlNet on Automatic1111 1.5.1 with no custom changes.

@trojan-uma
Copy link

1.install Microsoft Visual C++ (https://visualstudio.microsoft.com/visual-cpp-build-tools/)

2.run webui-user.bat

@AllInOneMighty
Copy link

I do not have a build error anymore at startup, but the No module named 'mmpose' error still happens.

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.5.1
Commit hash: 68f336bd994bed5442ad95bad6b6ad5564a5409a


Looking in links: https://download.openmmlab.com/mmcv/dist/cu118/torch2.0.0/index.html
Collecting mmdet>=3.1.0
  Using cached mmdet-3.1.0-py3-none-any.whl (2.0 MB)
Requirement already satisfied: matplotlib in s:\install\sd.webui\system\python\lib\site-packages (from mmdet>=3.1.0) (3.7.1)
Requirement already satisfied: numpy in s:\install\sd.webui\system\python\lib\site-packages (from mmdet>=3.1.0) (1.23.5)Collecting pycocotools (from mmdet>=3.1.0)
  Using cached pycocotools-2.0.6.tar.gz (24 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
Looking in links: https://download.openmmlab.com/mmcv/dist/cu118/torch2.0.0/index.html
Collecting mmpose>=1.1.0
  Using cached mmpose-1.1.0-py2.py3-none-any.whl (1.3 MB)
Collecting chumpy (from mmpose>=1.1.0)
  Using cached chumpy-0.70.tar.gz (50 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting json-tricks (from mmpose>=1.1.0)
  Using cached json_tricks-3.17.2-py2.py3-none-any.whl (27 kB)
Requirement already satisfied: matplotlib in s:\install\sd.webui\system\python\lib\site-packages (from mmpose>=1.1.0) (3.7.1)
Collecting munkres (from mmpose>=1.1.0)
  Using cached munkres-1.1.4-py2.py3-none-any.whl (7.0 kB)
Requirement already satisfied: numpy in s:\install\sd.webui\system\python\lib\site-packages (from mmpose>=1.1.0) (1.23.5)
Requirement already satisfied: opencv-python in s:\install\sd.webui\system\python\lib\site-packages (from mmpose>=1.1.0) (4.7.0.72)
Requirement already satisfied: pillow in s:\install\sd.webui\system\python\lib\site-packages (from mmpose>=1.1.0) (9.5.0)
Requirement already satisfied: scipy in s:\install\sd.webui\system\python\lib\site-packages (from mmpose>=1.1.0) (1.10.1)
Requirement already satisfied: torchvision in s:\install\sd.webui\system\python\lib\site-packages (from mmpose>=1.1.0) (0.15.2+cu118)
Collecting xtcocotools>=1.12 (from mmpose>=1.1.0)
  Using cached xtcocotools-1.13-cp310-cp310-win_amd64.whl (79 kB)
Requirement already satisfied: mmcv<2.1.0,>=2.0.0 in s:\install\sd.webui\system\python\lib\site-packages (from mmpose>=1.1.0) (2.0.1)
Collecting mmdet<3.2.0,>=3.0.0 (from mmpose>=1.1.0)
  Using cached mmdet-3.1.0-py3-none-any.whl (2.0 MB)
Requirement already satisfied: mmengine<1.0.0,>=0.4.0 in s:\install\sd.webui\system\python\lib\site-packages (from mmpose>=1.1.0) (0.8.4)
Requirement already satisfied: addict in s:\install\sd.webui\system\python\lib\site-packages (from mmcv<2.1.0,>=2.0.0->mmpose>=1.1.0) (2.4.0)
Requirement already satisfied: packaging in s:\install\sd.webui\system\python\lib\site-packages (from mmcv<2.1.0,>=2.0.0->mmpose>=1.1.0) (23.1)
Requirement already satisfied: pyyaml in s:\install\sd.webui\system\python\lib\site-packages (from mmcv<2.1.0,>=2.0.0->mmpose>=1.1.0) (6.0)
Requirement already satisfied: yapf in s:\install\sd.webui\system\python\lib\site-packages (from mmcv<2.1.0,>=2.0.0->mmpose>=1.1.0) (0.40.0)
Requirement already satisfied: regex in s:\install\sd.webui\system\python\lib\site-packages (from mmcv<2.1.0,>=2.0.0->mmpose>=1.1.0) (2023.6.3)
Collecting pycocotools (from mmdet<3.2.0,>=3.0.0->mmpose>=1.1.0)
  Using cached pycocotools-2.0.6.tar.gz (24 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'



You are up to date with the most recent release.
Launching Web UI with arguments: --autolaunch --ckpt-dir P:\Stable Diffusion\models\Stable-diffusion --lora-dir P:\Stable Diffusion\models\Lora --update-check --vae-dir P:\Stable Diffusion\models\VAE --xformers
Civitai Helper: Get Custom Model Folder
Civitai Helper: Load setting from: S:\Install\sd.webui\webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\setting.json
Civitai Helper: No setting file, use default
Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu.
[-] ADetailer initialized. version: 23.7.11, num models: 9
2023-08-04 16:05:26,622 - ControlNet - INFO - ControlNet v1.1.236
*** Error loading script: controlnet.py
    Traceback (most recent call last):
      File "S:\Install\sd.webui\webui\modules\scripts.py", line 319, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "S:\Install\sd.webui\webui\modules\script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "S:\Install\sd.webui\webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 14, in <module>
        from scripts.controlnet_ui import controlnet_ui_group
      File "S:\Install\sd.webui\webui\extensions\sd-webui-controlnet\scripts\controlnet_ui\controlnet_ui_group.py", line 22, in <module>
        from scripts.controlnet_ui.openpose_editor import OpenposeEditor
      File "S:\Install\sd.webui\webui\extensions\sd-webui-controlnet\scripts\controlnet_ui\openpose_editor.py", line 6, in <module>
        from annotator.openpose import decode_json_as_poses, draw_poses
      File "S:\Install\sd.webui\webui\extensions\sd-webui-controlnet\annotator\openpose\__init__.py", line 20, in <module>
        from .wholebody import Wholebody # DW Pose
      File "S:\Install\sd.webui\webui\extensions\sd-webui-controlnet\annotator\openpose\wholebody.py", line 3, in <module>
        from mmpose.apis import inference_topdown
    ModuleNotFoundError: No module named 'mmpose'

---
2023-08-04 16:05:26,628 - ControlNet - INFO - ControlNet v1.1.236
sd-webui-prompt-all-in-one background API service started successfully.
Loading weights [919326dee2] from P:\Stable Diffusion\models\Stable-diffusion\aniverse_V11Pruned.safetensors
Creating model from config: S:\Install\sd.webui\webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 39.1s (launcher: 22.3s, import torch: 2.5s, import gradio: 0.8s, setup paths: 0.5s, other imports: 0.6s, list SD models: 3.5s, load scripts: 4.1s, create ui: 1.1s, gradio launch: 2.3s, app_started_callback: 1.5s).
Applying attention optimization: xformers... done.
Model loaded in 32.2s (load weights from disk: 1.2s, create model: 0.4s, apply weights to model: 29.7s, apply half(): 0.5s, move model to device: 0.5s).

@huchenlei
Copy link
Collaborator

v1.1.237 delays the import of mmpose, so that other functionalities are not affected.

@huchenlei
Copy link
Collaborator

@AllInOneMighty Do you have the program working now?

@rltgjqmcpgjadyd
Copy link
Author

v1.1.237 controlnet is working
but DW preprocessor is not working
mmcv 2.0.1 already installed

here's the error message

2023-08-05 12:28:44,688 - ControlNet - INFO - Preview Resolution = 512
Traceback (most recent call last):
File "J:\SDWebUI\venv\Lib\site-packages\gradio\routes.py", line 442, in run_predict
output = await app.get_blocks().process_api(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "J:\SDWebUI\venv\Lib\site-packages\gradio\blocks.py", line 1392, in process_api
result = await self.call_function(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "J:\SDWebUI\venv\Lib\site-packages\gradio\blocks.py", line 1097, in call_function
prediction = await anyio.to_thread.run_sync(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "J:\SDWebUI\venv\Lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "J:\SDWebUI\venv\Lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "J:\SDWebUI\venv\Lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "J:\SDWebUI\venv\Lib\site-packages\gradio\utils.py", line 703, in wrapper
response = f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "J:\SDWebUI\extensions\sd-webui-controlnet\scripts\controlnet_ui\controlnet_ui_group.py", line 606, in run_annotator
result, is_image = preprocessor(
^^^^^^^^^^^^^
File "J:\SDWebUI\extensions\sd-webui-controlnet\scripts\utils.py", line 79, in decorated_func
return cached_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "J:\SDWebUI\extensions\sd-webui-controlnet\scripts\utils.py", line 67, in cached_func
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "J:\SDWebUI\extensions\sd-webui-controlnet\scripts\global_state.py", line 35, in unified_preprocessor
return preprocessor_modules[preprocessor_name](*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "J:\SDWebUI\extensions\sd-webui-controlnet\scripts\processor.py", line 265, in run_model
return remove_pad(self.model_openpose(
^^^^^^^^^^^^^^^^^^^^
File "J:\SDWebUI\extensions\sd-webui-controlnet\annotator\openpose_init_.py", line 360, in call
poses = self.detect_poses_dw(oriImg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "J:\SDWebUI\extensions\sd-webui-controlnet\annotator\openpose_init_.py", line 327, in detect_poses_dw
from .wholebody import Wholebody # DW Pose
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "J:\SDWebUI\extensions\sd-webui-controlnet\annotator\openpose\wholebody.py", line 9, in
from mmdet.apis import inference_detector, init_detector
File "J:\SDWebUI\venv\Lib\site-packages\mmdet\apis_init_.py", line 2, in
from .det_inferencer import DetInferencer
File "J:\SDWebUI\venv\Lib\site-packages\mmdet\apis\det_inferencer.py", line 21, in
from mmdet.evaluation import INSTANCE_OFFSET
File "J:\SDWebUI\venv\Lib\site-packages\mmdet\evaluation_init_.py", line 3, in
from .metrics import * # noqa: F401,F403
^^^^^^^^^^^^^^^^^^^^^^
File "J:\SDWebUI\venv\Lib\site-packages\mmdet\evaluation\metrics_init_.py", line 5, in
from .coco_metric import CocoMetric
File "J:\SDWebUI\venv\Lib\site-packages\mmdet\evaluation\metrics\coco_metric.py", line 18, in
from mmdet.structures.mask import encode_mask_results
File "J:\SDWebUI\venv\Lib\site-packages\mmdet\structures\mask_init_.py", line 3, in
from .structures import (BaseInstanceMasks, BitmapMasks, PolygonMasks,
File "J:\SDWebUI\venv\Lib\site-packages\mmdet\structures\mask\structures.py", line 12, in
from mmcv.ops.roi_align import roi_align
File "J:\SDWebUI\venv\Lib\site-packages\mmcv\ops_init_.py", line 2, in
from .active_rotated_filter import active_rotated_filter
File "J:\SDWebUI\venv\Lib\site-packages\mmcv\ops\active_rotated_filter.py", line 10, in
ext_module = ext_loader.load_ext(
^^^^^^^^^^^^^^^^^^^^
File "J:\SDWebUI\venv\Lib\site-packages\mmcv\utils\ext_loader.py", line 13, in load_ext
ext = importlib.import_module('mmcv.' + name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\gojas\AppData\Local\Programs\Python\Python311\Lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'mmcv._ext'

webui is latest dev branch

I HATE mmcv

@AllInOneMighty
Copy link

@AllInOneMighty Do you have the program working now?

ControlNet seems to be working for me. Thank you!

@eastone11
Copy link

Building wheels for collected packages: pycocotools
Building wheel for pycocotools (pyproject.toml): started
Building wheel for pycocotools (pyproject.toml): finished with status 'error'
Failed to build pycocotools

@huchenlei
Copy link
Collaborator

Building wheels for collected packages: pycocotools Building wheel for pycocotools (pyproject.toml): started Building wheel for pycocotools (pyproject.toml): finished with status 'error' Failed to build pycocotools

See #1864 (comment)

@eastone11
Copy link

did not help

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

6 participants
@AllInOneMighty @huchenlei @trojan-uma @rltgjqmcpgjadyd @eastone11 and others