Spaces:
Running
Running
serdaryildiz
commited on
Commit
•
11e0414
1
Parent(s):
62d8c66
half bug fixed!
Browse files- Model/trcaptionnet.py +2 -3
Model/trcaptionnet.py
CHANGED
@@ -40,11 +40,10 @@ class TRCaptionNet(nn.Module):
|
|
40 |
# vision encoder
|
41 |
self.vision_encoder, preprocess = clip.load(config["clip"], jit=False)
|
42 |
self.vision_encoder.eval()
|
43 |
-
self.vision_encoder = self.vision_encoder.visual
|
44 |
with torch.no_grad():
|
45 |
-
dummy_input_image = preprocess(Image.fromarray(numpy.zeros((512, 512, 3), dtype=numpy.uint8))).to(next(self.parameters()).device)
|
46 |
encoder_output_size = self.vision_encoder(dummy_input_image.unsqueeze(0)).shape[-1]
|
47 |
-
self.vision_encoder = self.vision_encoder.float()
|
48 |
|
49 |
# language decoder
|
50 |
if not os.path.isfile(config["bert"]):
|
|
|
40 |
# vision encoder
|
41 |
self.vision_encoder, preprocess = clip.load(config["clip"], jit=False)
|
42 |
self.vision_encoder.eval()
|
43 |
+
self.vision_encoder = self.vision_encoder.visual.float()
|
44 |
with torch.no_grad():
|
45 |
+
dummy_input_image = preprocess(Image.fromarray(numpy.zeros((512, 512, 3), dtype=numpy.uint8))).to(next(self.parameters()).device)
|
46 |
encoder_output_size = self.vision_encoder(dummy_input_image.unsqueeze(0)).shape[-1]
|
|
|
47 |
|
48 |
# language decoder
|
49 |
if not os.path.isfile(config["bert"]):
|