Giter VIP home page Giter VIP logo

Comments (10)

pharmapsychotic avatar pharmapsychotic commented on June 1, 2024 2

It required BLIP being installed as an "egg". Thanks to @justindujardin the BLIP install no longer needs to be egg. I've updated the instructions now. Let me know if this fixes things for ya!

# install torch with GPU support for example:
pip3 install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu117

# install clip-interrogator and blip
pip install clip-interrogator==0.3.3
pip install git+https://github.com/pharmapsychotic/BLIP.git

from clip-interrogator.

pharmapsychotic avatar pharmapsychotic commented on June 1, 2024 2

Okay! Thanks so much @justindujardin and @ZetiMente install should be simplified now to just pip install clip-interrogator==0.3.5 \o/
@dante8300 can you give it a try? Everything work now for ya?

from clip-interrogator.

justindujardin avatar justindujardin commented on June 1, 2024 1

Thanks for the excellent project and for absorbing the package changes. I can confirm that your install instructions work without my fork now.

BTW, If you wanted to simplify to just pip installing clip-interrogator, you could probably do it like this: https://github.com/justindujardin/clip-interrogator/commit/a766f19db6ee06f31f7a80d823224dfb3dad4682

from clip-interrogator.

pharmapsychotic avatar pharmapsychotic commented on June 1, 2024 1

@justindujardin ooh finally a syntax that works with setup.py BUT ultimately didn't work with pip install 😢 ERROR: Packages installed from PyPI cannot depend on packages which are not also hosted on PyPI.
So I think options are
a) post a BLIP package to pypi like ci-blip or something
b) just move the BLIP code to sub directory of this repo and bundle up together for easy pip install.

from clip-interrogator.

pharmapsychotic avatar pharmapsychotic commented on June 1, 2024 1

@ZetiMente ooh nice find! I'll test that version out.

from clip-interrogator.

alienfractal avatar alienfractal commented on June 1, 2024

Hi @pharmapsychotic, thanks for getting back. The error has changed slightly. Currently, I have
torchvision --extra-index-url https://download.pytorch.org/whl/cu116 which matches the version I have but not sure if the diff in version is related. Is there anything else i could try?

Loading BLIP model...
Traceback (most recent call last):
  File "C:\lien\style-transfer\diff\clip-interrogator\run_cli.py", line 93, in <module>
    main()
  File "C:\ken\style-transfer\diff\clip-interrogator\run_cli.py", line 54, in main
    ci = Interrogator(config)
  File "C:\Users\ken\Anaconda2\envs\StableDiffusion\lib\site-packages\clip_interrogator\clip_interrogator.py", line 58, in __init__
    blip_model = blip_decoder(
  File "C:\Users\ken\Anaconda2\envs\StableDiffusion\lib\site-packages\blip\models\blip.py", line 175, in blip_decoder
    model,msg = load_checkpoint(model,pretrained)
  File "C:\Users\ken\Anaconda2\envs\StableDiffusion\lib\site-packages\blip\models\blip.py", line 218, in load_checkpoint
    checkpoint = torch.load(cached_file, map_location='cpu')
  File "C:\Users\ken\Anaconda2\envs\StableDiffusion\lib\site-packages\torch\serialization.py", line 777, in load
    with _open_zipfile_reader(opened_file) as opened_zipfile:
  File "C:\Users\ken\Anaconda2\envs\StableDiffusion\lib\site-packages\torch\serialization.py", line 282, in __init__
    super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

from clip-interrogator.

alienfractal avatar alienfractal commented on June 1, 2024

Seems to be stuck at loading the checkpoint. Not sure what to make to this error, any advice is welcome.

This is how i am calling the client i guess nothing wrong there? python run_cli.py -i "image.PNG"

Is there a parameter to force it to use GPU ?

from clip-interrogator.

alienfractal avatar alienfractal commented on June 1, 2024

I found the parameters in the code, i think now its working. One thing i noticed was that sometimes the downloading of the BLiP_MODEL halts almost at the end, which could be why it gets corrupted. But that was just a theory.
image

I added the following parameters to the Interrogator Config, and it forced me to download the model again, updating the file in the process. It works, but I see that 6GB in VRAM is not enough.
from PIL import Image from clip_interrogator import Config, Interrogator image_path="sa1.PNG" image = Image.open(image_path).convert('RGB') ci = Interrogator(Config(clip_model_name="ViT-L-14/openai",blip_model_type="base",device="cuda",blip_max_length=24)) print(ci.interrogate(image))

from clip-interrogator.

alienfractal avatar alienfractal commented on June 1, 2024

@pharmapsychotic, just to let you know its solved, thanks for the help.

from clip-interrogator.

pharmapsychotic avatar pharmapsychotic commented on June 1, 2024

outstanding! hmm yeah looks like maybe the large model you have partially downloaded and is incomplete corrupted file.

from clip-interrogator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.