Skip to content

Mismatching CLIP model? #3

@unrealfuzzy

Description

@unrealfuzzy

Hi, ran into an issue with running 5_MAGnet_Generate_Modern_Paintings.ipynb
Exact problem is this:

import clip
from PIL import Image
device = "cpu"
model, preprocess = clip.load("ViT-B/32", device=device)
...
input_resolution = model.input_resolution.item()

which produces this:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib64/python3.7/site-packages/torch/nn/modules/module.py", line 1131, in __getattr__
    type(self).__name__, name))
AttributeError: 'CLIP' object has no attribute 'input_resolution'

So seem like current CLIP implementation that was pulled from GitHub doesn't have input_resolution method, and it's not entirely clear what substitute to use. I tried a (512, 512) touple along with just 512 integer and it doesn't seem to work.

Could you please help me out on this one?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions