Comments (10)
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.
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.
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.
@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.
@ZetiMente ooh nice find! I'll test that version out.
from clip-interrogator.
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.
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.
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.
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.
@pharmapsychotic, just to let you know its solved, thanks for the help.
from clip-interrogator.
outstanding! hmm yeah looks like maybe the large model you have partially downloaded and is incomplete corrupted file.
from clip-interrogator.
Related Issues (20)
- Only keeping flavors.txt and removing other data files HOT 1
- Clip Interrogator EXT issue - incorrect prompt
- Interrogator 1: RuntimeError: The size of tensor a (3) must match the size of tensor b (9) at non-singleton dimension 0
- How to speed up? Which torch version is suggested HOT 3
- How to set lowvram mode on via settings?
- two errors
- Prompt generation issiue
- timing interrogation
- Is there any way to only return caption without tag
- Error occurred when executing ClipInterrogator: Remote end closed connection without response HOT 1
- How to set interrogation mode when used in another script?
- cannot find python: which version HOT 1
- Are there any expansion plans for comfyui? HOT 6
- run_cli.py just freezes? import open_clip freezes? HOT 1
- Exception <class 'RuntimeError'> HOT 4
- Does clip-interrogator have built-in queue processing? HOT 1
- Downloads BLIP Checkpoint every time HOT 2
- What does "Ranking against your own list of terms?" mean?
- SD crashed after install CLIP, how to fix it or remove it?
- Loading flavors.txt is very slow HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clip-interrogator.