Giter VIP home page Giter VIP logo

Comments (10)

screan avatar screan commented on June 7, 2024 2

ah! it happens when run in "cpu" mode. if you do have gpu make sure to run pip3 install --upgrade torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117 to get a version of torch that supports GPU. I'll update README and add handling for CPU so it doesn't die from using half's

YES, thank you this fixed it. Weird I have a 3090..

I am able to run locally in browser!

from clip-interrogator.

pharmapsychotic avatar pharmapsychotic commented on June 7, 2024 1

ah it looks like you're running the .ipynb Jupyter notebook and it is trying to run wget command to download the cached preprocessed files. instead I'd recommend running pip install gradio and then python3 run_gradio.py that'll give you a nice web ui to use locally.
I'll also look into changing the notebook away from using wget 👍

from clip-interrogator.

pharmapsychotic avatar pharmapsychotic commented on June 7, 2024 1

ah! it happens when run in "cpu" mode. if you do have gpu make sure to run
pip3 install --upgrade torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117 to get a version of torch that supports GPU.
I'll update README and add handling for CPU so it doesn't die from using half's

from clip-interrogator.

johnclendenen avatar johnclendenen commented on June 7, 2024 1

ok instructions updated and version 0.3.1 that handles running on CPU again published!

Was this pushed? I don't see any CPU specific instructions in the README and I'm still hitting the float/half error.

from clip-interrogator.

screan avatar screan commented on June 7, 2024

thanks!, @pharmapsychotic getting this now

Loading CLIP model...
Preprocessing artists:   0%|                                                                                         | 0/5 [00:01<?, ?it/s]
Traceback (most recent call last):
  File "\clip-interrogator\run_gradio.py", line 11, in <module>
    ci = Interrogator(Config(cache_path="cache", clip_model_path="cache"))
  File "\clip-interrogator\clip_interrogator\clip_interrogator.py", line 70, in __init__
    self.load_clip_model()
  File "\clip-interrogator\clip_interrogator\clip_interrogator.py", line 105, in load_clip_model
    self.artists = LabelTable(artists, "artists", self.clip_model, self.tokenize, config)
  File "\clip-interrogator\clip_interrogator\clip_interrogator.py", line 268, in __init__
    text_features = clip_model.encode_text(text_tokens)
  File "AppData\Local\Programs\Python\Python310\lib\site-packages\open_clip\model.py", line 192, in encode_text
    x = self.transformer(x, attn_mask=self.attn_mask)
  File "\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
    return forward_call(*input, **kwargs)
  File "AppData\Local\Programs\Python\Python310\lib\site-packages\open_clip\transformer.py", line 230, in forward
    x = r(x, attn_mask=attn_mask)
  File "AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
    return forward_call(*input, **kwargs)
  File "AppData\Local\Programs\Python\Python310\lib\site-packages\open_clip\transformer.py", line 154, in forward
    x = x + self.ls_1(self.attention(self.ln_1(x), attn_mask=attn_mask))
  File "AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
    return forward_call(*input, **kwargs)
  File "AppData\Local\Programs\Python\Python310\lib\site-packages\open_clip\transformer.py", line 18, in forward
    x = F.layer_norm(x.to(torch.float32), self.normalized_shape, self.weight, self.bias, self.eps)
  File "\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\functional.py", line 2515, in layer_norm
    return torch.layer_norm(input, normalized_shape, weight, bias, eps, torch.backends.cudnn.enabled)
RuntimeError: expected scalar type Float but found Half

from clip-interrogator.

pharmapsychotic avatar pharmapsychotic commented on June 7, 2024

thanks, in a fresh environment I get that too but not in my other environments 🤔 it may be difference in behavior with different torch version, I'm investigating!

from clip-interrogator.

pharmapsychotic avatar pharmapsychotic commented on June 7, 2024

ok instructions updated and version 0.3.1 that handles running on CPU again published!

from clip-interrogator.

screan avatar screan commented on June 7, 2024

@pharmapsychotic Getting an error now that GPU is not available with last update. Is there a way to not use CPU?

CUDA is not available, using CPU. Warning: this will be very slow!

from clip-interrogator.

pharmapsychotic avatar pharmapsychotic commented on June 7, 2024

@screan check to make sure your installed torch has cuda enabled

python
import torch
torch.cuda.is_available()

from clip-interrogator.

screan avatar screan commented on June 7, 2024

@pharmapsychotic thanks reinstalled cuda tools / pytorch. all working now. appreciate it.

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.