pharmapsychotic / clip-interrogator

Image to prompt with BLIP and CLIP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with too many positional arguments

Nautilusera opened this issue · comments

Hi everyone,
I tried to install the CLIP-Interrogator locally as a script by following these instructions: https://pypi.org/project/clip-interrogator/
I created the virtual environment, then installed the necessary dependencies.

One change I did was to install torchvision with cu118 instead of cu117.
I don't think this is the source of the problem but I would prefer not having to download torchvision with cu117 to test it because my internet connection is limited at the moment.

When I tried to run the script I get the following error:

File "/home/nemo/nemo/newAIssistant/test-clip-interrogator.py", line 6, in <module>
    print(ci.interrogate(image))
  File "/home/nemo/clipInerrogator/lib/python3.9/site-packages/clip_interrogator/clip_interrogator.py", line 257, in interrogate
    merged = _merge_tables([self.artists, self.flavors, self.mediums, self.movements, self.trendings], self.config)
  File "/home/nemo/clipInerrogator/lib/python3.9/site-packages/clip_interrogator/clip_interrogator.py", line 429, in _merge_tables
    m = LabelTable([], None, None, None, config)
TypeError: __init__() takes 4 positional arguments but 6 were given

I looked around but haven't found a solution to that problem.

Thanks you for the script, and for the help.
Please let me know if you need any more information.

I also encountered the same problem.
My solution was to replace the clip-interrogator version to 0.6.0.
Hope this helps you.
pip uninstall clip-interrogator
pip install clip-interrogator==0.6.0

Thank you @Dorothy863, I will try this in a day or two when my monthly internet limit is restarted.
My clip-interrogator is at version 0.5.5, so what you propose looks promising.
Thanks again and have good day

Hi @Dorothy863, I just wanted to thank you, your solution worked like a charm.
Take care and have a good day.