[GH-ISSUE #286] clip prepross output one same value #249

Closed
opened 2026-10-31 21:12:55 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @SCAUapc on GitHub (Sep 2, 2022).
Original GitHub issue: https://github.com/openai/CLIP/issues/286

Hi, I use clip prepross, and find that it output the same value on the same RGB dim.

`import torch
import clip
from PIL import Image

device = "cuda:2" if torch.cuda.is_available() else "cpu" # If using GPU then use mixed precision training.
model, preprocess = clip.load("ViT-B/32",device=device,jit=False) #Must set jit=False for training

print(preprocess(Image.open("./data/self_data/meme_set/1002.jpeg")))
tensor([[[1.9303, 1.9303, 1.9303, ..., 1.9303, 1.9303, 1.9303],
[1.9303, 1.9303, 1.9303, ..., 1.9303, 1.9303, 1.9303],
[1.9303, 1.9303, 1.9303, ..., 1.9303, 1.9303, 1.9303],
...,
[1.9303, 1.9303, 1.9303, ..., 1.9303, 1.9303, 1.9303],
[1.9303, 1.9303, 1.9303, ..., 1.9303, 1.9303, 1.9303],
[1.9303, 1.9303, 1.9303, ..., 1.9303, 1.9303, 1.9303]],

    [[2.0749, 2.0749, 2.0749,  ..., 2.0749, 2.0749, 2.0749],
     [2.0749, 2.0749, 2.0749,  ..., 2.0749, 2.0749, 2.0749],
     [2.0749, 2.0749, 2.0749,  ..., 2.0749, 2.0749, 2.0749],
     ...,
     [2.0749, 2.0749, 2.0749,  ..., 2.0749, 2.0749, 2.0749],
     [2.0749, 2.0749, 2.0749,  ..., 2.0749, 2.0749, 2.0749],
     [2.0749, 2.0749, 2.0749,  ..., 2.0749, 2.0749, 2.0749]],

    [[2.1459, 2.1459, 2.1459,  ..., 2.1459, 2.1459, 2.1459],
     [2.1459, 2.1459, 2.1459,  ..., 2.1459, 2.1459, 2.1459],
     [2.1459, 2.1459, 2.1459,  ..., 2.1459, 2.1459, 2.1459],
     ...,
     [2.1459, 2.1459, 2.1459,  ..., 2.1459, 2.1459, 2.1459],
     [2.1459, 2.1459, 2.1459,  ..., 2.1459, 2.1459, 2.1459],
     [2.1459, 2.1459, 2.1459,  ..., 2.1459, 2.1459, 2.1459]]])

`

It make train impossible, can everybody help me? thanks.

Originally created by @SCAUapc on GitHub (Sep 2, 2022). Original GitHub issue: https://github.com/openai/CLIP/issues/286 Hi, I use clip prepross, and find that it output the same value on the same RGB dim. `import torch import clip from PIL import Image device = "cuda:2" if torch.cuda.is_available() else "cpu" # If using GPU then use mixed precision training. model, preprocess = clip.load("ViT-B/32",device=device,jit=False) #Must set jit=False for training print(preprocess(Image.open("./data/self_data/meme_set/1002.jpeg"))) tensor([[[1.9303, 1.9303, 1.9303, ..., 1.9303, 1.9303, 1.9303], [1.9303, 1.9303, 1.9303, ..., 1.9303, 1.9303, 1.9303], [1.9303, 1.9303, 1.9303, ..., 1.9303, 1.9303, 1.9303], ..., [1.9303, 1.9303, 1.9303, ..., 1.9303, 1.9303, 1.9303], [1.9303, 1.9303, 1.9303, ..., 1.9303, 1.9303, 1.9303], [1.9303, 1.9303, 1.9303, ..., 1.9303, 1.9303, 1.9303]], [[2.0749, 2.0749, 2.0749, ..., 2.0749, 2.0749, 2.0749], [2.0749, 2.0749, 2.0749, ..., 2.0749, 2.0749, 2.0749], [2.0749, 2.0749, 2.0749, ..., 2.0749, 2.0749, 2.0749], ..., [2.0749, 2.0749, 2.0749, ..., 2.0749, 2.0749, 2.0749], [2.0749, 2.0749, 2.0749, ..., 2.0749, 2.0749, 2.0749], [2.0749, 2.0749, 2.0749, ..., 2.0749, 2.0749, 2.0749]], [[2.1459, 2.1459, 2.1459, ..., 2.1459, 2.1459, 2.1459], [2.1459, 2.1459, 2.1459, ..., 2.1459, 2.1459, 2.1459], [2.1459, 2.1459, 2.1459, ..., 2.1459, 2.1459, 2.1459], ..., [2.1459, 2.1459, 2.1459, ..., 2.1459, 2.1459, 2.1459], [2.1459, 2.1459, 2.1459, ..., 2.1459, 2.1459, 2.1459], [2.1459, 2.1459, 2.1459, ..., 2.1459, 2.1459, 2.1459]]]) ` It make train impossible, can everybody help me? thanks.
Author
Owner

@SCAUapc commented on GitHub (Sep 2, 2022):

maybe it's because my data is always with same colour

<!-- gh-comment-id:1235232810 --> @SCAUapc commented on GitHub (Sep 2, 2022): maybe it's because my data is always with same colour
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openai/CLIP#249
No description provided.