-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Openai-L-14-336 #19
Comments
the model struct that load by your code is is: |
Could you provide a more complete code? The example given here is able to run correctly. |
processor = CLIPImageProcessor.from_pretrained("/group/40048/keningliu/tools/models/clip-vit-large-patch14-336") image = Image.open(image_path)
print("Label probs:", text_probs) |
I found that when loading the model, the weight files mentioned in your paper were not loaded. Instead, only the CLIP structure was loaded, which makes it impossible to conduct inference. |
Expected tensor for argument #1 'indices' to have one of the following scalar types: Long, Int; but got torch.cuda.FloatTensor instead (while checking arguments for embedding)
input_pixels = processor(images=image, return_tensors="pt").pixel_values.to('cuda')
text_features = l2v.encode(captions, convert_to_tensor=True).to("cuda")
with torch.no_grad(), torch.cuda.amp.autocast():
image_features = model.get_image_features(input_pixels)
text_features = model.get_text_features(text_features)
print("Label probs:", text_probs)
When I try to use LLM2CLIP-Openai-L-14-336. this erro is appear?Can you fix it?
The text was updated successfully, but these errors were encountered: