You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Model to cpu
Inference started
0batch [00:02, ?batch/s]
Traceback (most recent call last):
File "C:\git\image-captioning\inference.py", line 88, in
caption = model.generate(
File "C:\git\image-captioning\models\blip.py", line 201, in generate
outputs = self.text_decoder.generate(
File "C:\Python\Python310\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\transformers\generation\utils.py", line 1752, in generate
return self.beam_search(
File "C:\Python\Python310\lib\site-packages\transformers\generation\utils.py", line 3091, in beam_search
outputs = self(
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\git\image-captioning\models\med.py", line 886, in forward
outputs = self.bert(
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\git\image-captioning\models\med.py", line 781, in forward
encoder_outputs = self.encoder(
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\git\image-captioning\models\med.py", line 445, in forward
layer_outputs = layer_module(
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\git\image-captioning\models\med.py", line 361, in forward
cross_attention_outputs = self.crossattention(
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\git\image-captioning\models\med.py", line 277, in forward
self_outputs = self.self(
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\git\image-captioning\models\med.py", line 178, in forward
attention_scores = torch.matmul(query_layer, key_layer.transpose(-1, -2))
RuntimeError: The size of tensor a (3) must match the size of tensor b (9) at non-singleton dimension 0
The text was updated successfully, but these errors were encountered:
All of my images are 256x256 pixels (taken from images sample folder, just some of the 256x256 ones)
C:\git\image-captioning>python inference.py -i C:\git\image-captioning\inputs --batch 3 --gpu 0
Device: cpu
Images found: 8
Split size: 2
Checkpoint loading...
load checkpoint from ./checkpoints/model_large_caption.pth
Model to cpu
Inference started
0batch [00:02, ?batch/s]
Traceback (most recent call last):
File "C:\git\image-captioning\inference.py", line 88, in
caption = model.generate(
File "C:\git\image-captioning\models\blip.py", line 201, in generate
outputs = self.text_decoder.generate(
File "C:\Python\Python310\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\transformers\generation\utils.py", line 1752, in generate
return self.beam_search(
File "C:\Python\Python310\lib\site-packages\transformers\generation\utils.py", line 3091, in beam_search
outputs = self(
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\git\image-captioning\models\med.py", line 886, in forward
outputs = self.bert(
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\git\image-captioning\models\med.py", line 781, in forward
encoder_outputs = self.encoder(
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\git\image-captioning\models\med.py", line 445, in forward
layer_outputs = layer_module(
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\git\image-captioning\models\med.py", line 361, in forward
cross_attention_outputs = self.crossattention(
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\git\image-captioning\models\med.py", line 277, in forward
self_outputs = self.self(
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\git\image-captioning\models\med.py", line 178, in forward
attention_scores = torch.matmul(query_layer, key_layer.transpose(-1, -2))
RuntimeError: The size of tensor a (3) must match the size of tensor b (9) at non-singleton dimension 0
The text was updated successfully, but these errors were encountered: