[GH-ISSUE #386] Missing of a type conversion in model.py #333

Open
opened 2026-10-31 21:13:58 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @GXZlegend on GitHub (Sep 12, 2023).
Original GitHub issue: https://github.com/openai/CLIP/issues/386

There seems to miss a type conversion in the forward process of VisionTransformer, in clip/model.py. The direct forward pass without pre-conversion (Line 342) would cause error of type mismatch.

As a reference, in Line 146 there is an explicit type conversion in ModifiedResNet.

Is it possible to add conversion x = x.type(self.conv1.weight.dtype) between Line 223-224?

Originally created by @GXZlegend on GitHub (Sep 12, 2023). Original GitHub issue: https://github.com/openai/CLIP/issues/386 There seems to miss a type conversion in the forward process of `VisionTransformer`, in `clip/model.py`. The direct forward pass without pre-conversion (Line 342) would cause error of type mismatch. As a reference, in Line 146 there is an explicit type conversion in `ModifiedResNet`. Is it possible to add conversion `x = x.type(self.conv1.weight.dtype)` between Line 223-224?
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#333
No description provided.