Skip to content
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

swin_transformer: RuntimeError: Expected object of scalar type Float but got scalar type Half for argument #2 'mat2' in call to _th_bmm_out Images sizes do not match. This will causes images to be display incorrectly in the UI.` #62

Closed
yssid opened this issue Dec 18, 2021 · 1 comment

Comments

@yssid
Copy link

yssid commented Dec 18, 2021

when training swin_transformer receiving Error:
Here is the output: can you please explain what's the issue?.

`Epoch gpu_mem box obj cls total targets img_size
0/9 1.23G 0.08236 0.01982 0 0.1022 0 640: 100%|████████████████████████████████████████████████████| 1430/1430 [04:11<00:00, 5.68it/s]
Class Images Targets P R [email protected] [email protected]:.95: 0%| | 0/728 [00:00<?, ?it/s]

Traceback (most recent call last):
File "scripts/train.py", line 527, in
train(hyp, opt, device, tb_writer, wandb)
File "scripts/train.py", line 354, in train
compute_loss=compute_loss)
File ".\scripts\eval.py", line 109, in test
inf_out, train_out = model(img) # inference and training outputs

File "\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)

File ".\od\models\model.py", line 67, in forward
out = self.backbone(x)

File "\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)

File ".\od\models\backbone\swin_transformer.py", line 598, in forward
x_out, H, W, x, Wh, Ww = layer(x, Wh, Ww)

File "\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)

File ".\od\models\backbone\swin_transformer.py", line 382, in forward
x = blk(x, attn_mask)

File "\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)

File ".\od\models\backbone\swin_transformer.py", line 224, in forward
attn_windows = self.attn(x_windows, mask=attn_mask) # nWB, window_sizewindow_size, C

File "\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)

File ".\od\models\backbone\swin_transformer.py", line 142, in forward
x = (attn @ v).transpose(1, 2).reshape(B_, N, C)

RuntimeError: Expected object of scalar type Float but got scalar type Half for argument #2 'mat2' in call to _th_bmm_out
Images sizes do not match. This will causes images to be display incorrectly in the UI.`

@yssid yssid changed the title Getting RuntimeError: in Swin_Tranformer.py swin_transformer: RuntimeError: Expected object of scalar type Float but got scalar type Half for argument #2 'mat2' in call to _th_bmm_out Images sizes do not match. This will causes images to be display incorrectly in the UI.` Dec 18, 2021
@Bobo-y
Copy link
Owner

Bobo-y commented Dec 18, 2021

@yssid please see #34

@Bobo-y Bobo-y closed this as completed Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants