intel / openvino-ai-plugins-gimp

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

Does not work with Gimp 2.99.17 #68

Closed blackPantherOS closed 8 months ago

blackPantherOS commented 8 months ago

I tried use plugin with latest git Gimp (with previous 2.99.16 working)

(semseg-ov.py:1214390): LibGimp-WARNING **: 12:27:42.316: _gimp_procedure_run_array: no return values, shouldn't happen
[...]/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/semseg-ov/semseg-ov.py:314: Warning: g_error_new: assertion 'domain != 0' failed
  Gimp.main(SemSeg.__gtype__, sys.argv)
Traceback (most recent call last):
  File "[...]/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/fast-style-transfer-ov/fast-style-transfer-ov.py", line 157, in run
    device_name = args.index(0)
                  ^^^^^^^^^^
AttributeError: 'GimpProcedureConfig-fast-style-transfer-ov' object has no attribute 'index'

(fast-style-transfer-ov.py:1214408): LibGimp-WARNING **: 12:27:53.471: _gimp_procedure_run_array: no return values, shouldn't happen
[...]/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/fast-style-transfer-ov/fast-style-transfer-ov.py:320: Warning: g_error_new: assertion 'domain != 0' failed
  Gimp.main(Styletransfer.__gtype__, sys.argv)
Traceback (most recent call last):
  File "[...]/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/superresolution-ov/superresolution-ov.py", line 169, in run
    scale = args.index(0)
            ^^^^^^^^^^
AttributeError: 'GimpProcedureConfig-superresolution-ov' object has no attribute 'index'

(superresolution-ov.py:1214425): LibGimp-WARNING **: 12:28:05.289: _gimp_procedure_run_array: no return values, shouldn't happen
[...]/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/superresolution-ov/superresolution-ov.py:347: Warning: g_error_new: assertion 'domain != 0' failed
  Gimp.main(Superresolution.__gtype__, sys.argv)

I tried use Inpainting with CPU not GPU therefore CUDA is not in use. It doesn't work with either versions

Traceback (most recent call last):
  File "[...]/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/inpainting-ov/../../tools/inpainting-ov.py", line 10, in <module>
    import torch
  File "[...]//openvino-ai-plugins-gimp/gimpenv3/lib64/python3.11/site-packages/torch/__init__.py", line 235, in <module>
    from torch._C import *  # noqa: F403
    ^^^^^^^^^^^^^^^^^^^^^^
ImportError: libcudnn.so.8: cannot open shared object file: No such file or directory
gblong1 commented 8 months ago

Hi @blackPantherOS - We have only verified against 2.99.16 and 2.99.14 tags of GIMP. I don't see a tag for 2.99.17... are you referring to the latest main?

blackPantherOS commented 8 months ago

Hi @blackPantherOS - We have only verified against 2.99.16 and 2.99.14 tags of GIMP. I don't see a tag for 2.99.17... are you referring to the latest main?

Latest git , not tagged yet

gblong1 commented 8 months ago

Hi @blackPantherOS - We have not tested against the latest git, so i would not be surprised to find issues. For now, please the 2.99.16 tag.

blackPantherOS commented 2 months ago

Still does not work with 2.99.16:

Traceback (most recent call last):
  File "/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/superresolution-ov/../../tools/superresolution-ov.py", line 13, in <module>
    import torch
  File "/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib64/python3.11/site-packages/torch/__init__.py", line 239, in <module>
    from torch._C import *  # noqa: F403
    ^^^^^^^^^^^^^^^^^^^^^^
ImportError: libcudnn.so.8: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/superresolution-ov/../../tools/superresolution-ov.py", line 13, in <module>
    import torch
  File "/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib64/python3.11/site-packages/torch/__init__.py", line 239, in <module>
    from torch._C import *  # noqa: F403
    ^^^^^^^^^^^^^^^^^^^^^^
ImportError: libcudnn.so.8: cannot open shared object file: No such file or directory

Gimp 2.99.18 and 2.99-R2 OpenVino.

Issues:

1.)

Successfully installed gimpopenvino-0.0.1
*** openvino-ai-plugins-gimp Installed ***

##########

chmod: cannot access '/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/inpainting-ov/inpainting-ov.py': No such file or directory
chmod: cannot access '/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/fast-style-transfer-ov/fast-style-transfer-ov.py': No such file or directory
NOTE ! >> Please add this path to Preferences --> Plug-ins in GIMP :  /usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins

##########

Do you want to continue setting up the models for all the plugins now? Enter Y/N: 
You pressed 'y'. Continuing...
Traceback (most recent call last):
  File "/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/model_setup.py", line 15, in <module>
    for folder in os.scandir(src_dir):
                  ^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'openvino-ai-plugins-gimp/weights'
**** openvino-ai-plugins-gimp Setup Ended ****

The possible solution:

--- model_setup.py.orig 2024-04-24 20:06:13.000000000 +0200
+++ model_setup.py      2024-06-17 12:30:16.746818939 +0200
@@ -7,7 +7,7 @@

 other_models = os.path.join(os.path.expanduser("~"), "openvino-ai-plugins-gimp", "weights")
-src_dir = os.path.join("openvino-ai-plugins-gimp", "weights")
+src_dir = os.path.join("weights")
 test_path = os.path.join(other_models, "superresolution-ov")

 access_token  = None

2.)

From Gimp log:

Skipping unknown file '/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/__init__.py' in plug-in directory.
Skipping unknown file '/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/plugin_utils.py' in plug-in directory.

3.) Does not show OpenVino dialog in Gimp after clicked to any OpenVino-plugins submenu:

Traceback (most recent call last):
  File "/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/superresolution-ov/superresolution-ov.py", line 172, in run
    scale = args.index(0)
            ^^^^^^^^^^
AttributeError: 'GimpProcedureConfig-superresolution-ov' object has no attribute 'index'

(superresolution-ov.py:75646): LibGimp-WARNING **: 12:13:24.920: _gimp_procedure_run_array: no return values, shouldn't happen
/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/superresolution-ov/superresolution-ov.py:350: Warning: g_error_new: assertion 'domain != 0' failed
  Gimp.main(Superresolution.__gtype__, sys.argv)
Traceback (most recent call last):
  File "/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/semseg-ov/semseg-ov.py", line 147, in run
    device_name = args.index(0)
                  ^^^^^^^^^^
AttributeError: 'GimpProcedureConfig-semseg-ov' object has no attribute 'index'

(semseg-ov.py:75662): LibGimp-WARNING **: 12:13:34.423: _gimp_procedure_run_array: no return values, shouldn't happen
/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/semseg-ov/semseg-ov.py:314: Warning: g_error_new: assertion 'domain != 0' failed
  Gimp.main(SemSeg.__gtype__, sys.argv)
Traceback (most recent call last):
  File "/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/stable-diffusion-ov/stable-diffusion-ov.py", line 458, in run
    save_image(image, list_layers, os.path.join(config_path_output["weight_path"], "..", "layer_init_image.png"))
  File "/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/stable-diffusion-ov/../plugin_utils.py", line 50, in save_image
    Gimp.get_pdb().run_procedure(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'PDB' object has no attribute 'run_procedure'. Did you mean: 'lookup_procedure'?

(stable-diffusion-ov.py:75673): LibGimp-WARNING **: 12:13:40.021: _gimp_procedure_run_array: no return values, shouldn't happen
/usr/src/RPM/BUILD/openvino-ai-plugins-gimp/gimpenv3/lib/python3.11/site-packages/gimpopenvino/plugins/stable-diffusion-ov/stable-diffusion-ov.py:1166: Warning: g_error_new: assertion 'domain != 0' failed
  Gimp.main(StableDiffusion.__gtype__, sys.argv)
gblong1 commented 1 month ago

I have started looking at this, and confirm it doesn't work with tags greater than GIMP_2_99_14. I would suggest to use that until we can port to GIMP_2_99_18. I do see that there is some "weirdness" introduced in .18 especially with the way the UI window is redrawn every time a option is used. Seems to me to be a degradation in GTK, but will look into it.