intel / openvino-ai-plugins-gimp

GIMP AI plugins with OpenVINO Backend
Apache License 2.0
447 stars 49 forks source link

Encountered error while generating package metadata #63

Closed debug420 closed 8 months ago

debug420 commented 8 months ago
...
...
...
      [53/53] Cythonizing sklearn\utils\sparsefuncs_fast.pyx
          main()
        File "C:\Windows\model_conv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\Windows\model_conv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "E:\TEMP\pip-build-env-18ckwic4\overlay\Lib\site-packages\setuptools\build_meta.py", line 366, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "E:\TEMP\pip-build-env-18ckwic4\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "E:\TEMP\pip-build-env-18ckwic4\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 301, in <module>
        File "<string>", line 297, in setup_package
        File "E:\TEMP\pip-build-env-18ckwic4\overlay\Lib\site-packages\numpy\distutils\core.py", line 136, in setup
          config = configuration()
        File "<string>", line 188, in configuration
        File "E:\TEMP\pip-build-env-18ckwic4\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 1050, in add_subpackage
          config_list = self.get_subpackage(subpackage_name, subpackage_path,
        File "E:\TEMP\pip-build-env-18ckwic4\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 1016, in get_subpackage
          config = self._get_configuration_from_setup_py(
        File "E:\TEMP\pip-build-env-18ckwic4\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 958, in _get_configuration_from_setup_py
          config = setup_module.configuration(*args)
        File "E:\TEMP\pip-install-ty8ks29i\scikit-learn_c2d80b9645844171a8385047755ebc48\sklearn\setup.py", line 83, in configuration
          cythonize_extensions(top_path, config)
        File "E:\TEMP\pip-install-ty8ks29i\scikit-learn_c2d80b9645844171a8385047755ebc48\sklearn\_build_utils\__init__.py", line 70, in cythonize_extensions
          config.ext_modules = cythonize(
        File "E:\TEMP\pip-build-env-18ckwic4\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1145, in cythonize
          result.get(99999)  # seconds
        File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 771, in get
          raise self._value
      Cython.Compiler.Errors.CompileError: sklearn\ensemble\_hist_gradient_boosting\splitting.pyx
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

After I received the above error, I continued either way and received the following error:

=========Chose SD-1.5 models to download and convert=========
1 - Square (512x512 output image)
2 - Landscape (640x360 output image, 16:9)
3 - Portrait (360x640 output image, 9:16)
4 - Portrait_512x768 (512x768 output image), will take time since model is large
5 - Landscape_768x512 (768x512 output image),  will take time since model is large
6 - SD-1.5 Inapinting model (512x512 output image)
7 - SD-1.5 Controlnet-Openpose model (512x512 output image)
8 - SD-1.5 Controlnet-CannyEdge model (512x512 output image)
9 - ALL the above SD-1.5 models
10 - Only Square, Landscape, Portrait
11 - Skip All SD-1.5 Model setup
Enter the Number for the model you want to download & convert: 9
Traceback (most recent call last):
  File "C:\Windows\openvino-ai-plugins-gimp\sd_model_conversion.py", line 11, in <module>
    from diffusers import StableDiffusionPipeline, StableDiffusionInpaintPipeline
ModuleNotFoundError: No module named 'diffusers'
Traceback (most recent call last):
  File "C:\Windows\openvino-ai-plugins-gimp\sd_model_conversion.py", line 11, in <module>
    from diffusers import StableDiffusionPipeline, StableDiffusionInpaintPipeline
ModuleNotFoundError: No module named 'diffusers'
Traceback (most recent call last):
  File "C:\Windows\openvino-ai-plugins-gimp\sd_model_conversion.py", line 11, in <module>
    from diffusers import StableDiffusionPipeline, StableDiffusionInpaintPipeline
ModuleNotFoundError: No module named 'diffusers'
Traceback (most recent call last):
  File "C:\Windows\openvino-ai-plugins-gimp\sd_model_conversion.py", line 11, in <module>
    from diffusers import StableDiffusionPipeline, StableDiffusionInpaintPipeline
ModuleNotFoundError: No module named 'diffusers'
Traceback (most recent call last):
  File "C:\Windows\openvino-ai-plugins-gimp\sd_model_conversion.py", line 11, in <module>
    from diffusers import StableDiffusionPipeline, StableDiffusionInpaintPipeline
ModuleNotFoundError: No module named 'diffusers'
Traceback (most recent call last):
  File "C:\Windows\openvino-ai-plugins-gimp\sd_model_conversion.py", line 11, in <module>
    from diffusers import StableDiffusionPipeline, StableDiffusionInpaintPipeline
ModuleNotFoundError: No module named 'diffusers'
Traceback (most recent call last):
  File "C:\Windows\openvino-ai-plugins-gimp\controlnet_model_conversion.py", line 11, in <module>
    from diffusers import StableDiffusionControlNetPipeline, ControlNetModel
ModuleNotFoundError: No module named 'diffusers'
Traceback (most recent call last):
  File "C:\Windows\openvino-ai-plugins-gimp\controlnet_model_conversion.py", line 11, in <module>
    from diffusers import StableDiffusionControlNetPipeline, ControlNetModel
ModuleNotFoundError: No module named 'diffusers'
**** OPENVINO STABLE DIFFUSION 1.5 MODELS COMPLETE ****

I followed the following tutorial when downloading OpenVINO: https://docs.openvino.ai/2023.2/openvino_docs_install_guides_installing_openvino_from_archive_windows.html

Any ideas why this could be occuring? If any further information is required, let me know. Thanks

gblong1 commented 8 months ago

Hi @debug420 - Not sure on the the first error, as we've not seen that before. The second errors is related to an updated diffusers package. We will be making a formal release in the next day, which should fix the second issue, for sure.

gblong1 commented 8 months ago

Hi @debug420 - the new release has been pushed. Can you update your code and let me know if you are still seeing issues?

debug420 commented 8 months ago

I am now getting the following error when setting up: https://pastes.io/vmbocfccwc

It seems like everything aside from Stable diffusion works. When attempting to run stable diffusion on a layer, I get the following error in the output window:

Traceback (most recent call last):
  File "C:\Users\Admin\gimpenv3\lib\site-packages\gimpopenvino\plugins\stable-diffusion-ov\stable-diffusion-ov.py", line 443, in run
    list_models(config_path_output["weight_path"],"SD_1.5") +
  File "C:\Users\Admin\gimpenv3\lib\site-packages\gimpopenvino\plugins\stable-diffusion-ov\stable-diffusion-ov.py", line 184, in list_models
    for file in os.scandir(dir_path): #, recursive=True):
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\Admin\\openvino-ai-plugins-gimp\\weights\\stable-diffusion-ov\\stable-diffusion-1.5'

(stable-diffusion-ov.py:41592): LibGimp-WARNING **: 17:29:18.888: gimp_procedure_run: no return values, shouldn't happen
C:\Users\Admin\gimpenv3\lib\site-packages\gimpopenvino\plugins\stable-diffusion-ov\stable-diffusion-ov.py:1220: Warning: g_error_new: assertion 'domain != 0' failed
  Gimp.main(StableDiffusion.__gtype__, sys.argv)
gimp_plug_in_destroy_proxies: ERROR: GimpImage proxy with ID 23 was refed by plug-in, it MUST NOT do that!
gimp_plug_in_destroy_proxies: ERROR: GimpLayer proxy with ID 54 was refed by plug-in, it MUST NOT do that!
gblong1 commented 8 months ago

@debug420 - Thanks for the detailed log. The issue here is that the download of the models timed out and when you tried to run Stable Diffusion, the models were not present.

Can you rerun install.bat, Instead of downloading all, can you try just downloading the 1.5 square size and see if that works?

debug420 commented 8 months ago

The issue seems to be solved, however, I seem to be having an issue when attempting to run the model on my GPU. I have a GTX 1660 Ti. There seems to be no issue when running with CPU, however I will include the logs just in case.

I generated with the following prompt: "Generate a cricle in the middle with the face of a kangaroo in the middle"

CPU Log:

Details

https://pastes.io/8ylckvaeci (works fine but I thought I may as well include the log) Image generated by CPU: ![image](https://github.com/intel/openvino-ai-plugins-gimp/assets/64251443/893cf058-a01a-452a-bad7-e94687aaa5b2)

GPU Log:

Details

``` (stable-diffusion-ov.py:14196): Gtk-CRITICAL **: 21:00:18.164: gtk_grid_attach: assertion '_gtk_widget_get_parent (child) == NULL' failed (stable-diffusion-ov.py:14196): GLib-GIO-WARNING **: 21:00:18.596: Unexpectedly, UWP app `KDEe.V.Okular_23.801.1522.0_x64__7vt06qxq7ptv8' (AUMId `KDEe.V.Okular_7vt06qxq7ptv8!KDEe.V.Okular') supports 5 extensions but has no verbs Waiting Waiting stable-diffusion model server killed Waiting C:\Users\Admin\gimpenv3\lib\site-packages\ngraph\helpers.py:9: FutureWarning: OpenVINO Inference Engine Python API is deprecated and will be removed in 2024.0 release.For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html from openvino.inference_engine import IENetwork # type: ignore C:\Users\Admin\gimpenv3\Lib\site-packages\gimpopenvino\tools\openvino_common\models_ov\open_pose.py:18: FutureWarning: OpenVINO nGraph Python API is deprecated and will be removed in 2024.0 release.For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html import ngraph as ng C:\Users\Admin\gimpenv3\lib\site-packages\controlnet_aux\open_pose\body.py:7: DeprecationWarning: Please use `gaussian_filter` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated. from scipy.ndimage.filters import gaussian_filter C:\Users\Admin\gimpenv3\lib\site-packages\controlnet_aux\open_pose\hand.py:4: DeprecationWarning: Please use `gaussian_filter` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated. from scipy.ndimage.filters import gaussian_filter C:\Users\Admin\gimpenv3\lib\site-packages\controlnet_aux\mediapipe_face\mediapipe_face_common.py:7: UserWarning: The module 'mediapipe' is not installed. The package will have limited functionality. Please install it using the command: pip install 'mediapipe' warnings.warn( [ INFO ] Model Name: SD_1.4 [ INFO ] Initializing Inference Engine... [ INFO ] Model Path: C:\Users\Admin\openvino-ai-plugins-gimp\weights\stable-diffusion-ov\stable-diffusion-1.4 [ INFO ] device_name: ['GPU', 'GPU', 'GPU', 'GPU'] Text Device: GPU unet Device: GPU Vae Device: GPU Ready model load complete. Running SD async Waiting [ INFO ] Starting inference... [ INFO ] Prompt: Generate a cricle in the middle with the face of a kangaroo in the middle [ INFO ] negative_prompt: [ INFO ] num_inference_steps: 30 [ INFO ] guidance_scale: 7.5 [ INFO ] strength: 1.0 [ INFO ] init_image: None [ INFO ] Random Seed: 2611731093 Image is NONE 3%|█████▉ ``` After about 20 minutes, the model was loaded and after about 15 minutes, the first inference step was completed. My GPU usage can be found below: ![image](https://github.com/intel/openvino-ai-plugins-gimp/assets/64251443/f442e62c-8c49-4a81-bc54-fb2180a218e1)

Is this normal? I was under the impression that a GPU would be able to generate such content at a much faster rate.

gblong1 commented 8 months ago

Hi @debug420 - This project uses OpenVINO which is optimized for Intel Hardware, so it is not expected to be fast on an NVIDIA device. If use an Intel GPU, you will see much better performance.