-
Notifications
You must be signed in to change notification settings - Fork 21
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
Error reporting issue when adding batchformerv2 to other class detr models #26
Comments
Do you set the value of N to 8? it might be 4. |
Thank you for your prompt response. After trying your suggestion, the following error was reported. How can I resolve it? |
N in This line
|
Hi, Sorry for getting you late. According to the code, in detr, I set the default value in here |
Sorry to bother you.The error message is as follows. How can I resolve it?
root@i-r5mjznu9:/workspace/cbn/DINO# /opt/conda/lib/python3.8/site-packages/torch/tensor.py:559: UserWarning: floor_divide is deprecated, and will be removed in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values.
To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). (Triggered internally at ../aten/src/ATen/native/BinaryOps.cpp:335.)
return torch.floor_divide(self, other)
Traceback (most recent call last):
File "main.py", line 423, in
main(args)
File "main.py", line 309, in main
train_stats = train_one_epoch(
File "/workspace/cbn/DINO/engine.py", line 48, in train_one_epoch
outputs = model(samples, targets)
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in call_impl
result = self.forward(*input, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/torch/nn/parallel/distributed.py", line 707, in forward
output = self.module(*inputs[0], **kwargs[0])
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in call_impl
result = self.forward(*input, **kwargs)
File "/workspace/cbn/DINO/models/dino/dino.py", line 270, in forward
hs, reference, hs_enc, ref_enc, init_box_proposal = self.transformer(srcs, masks, input_query_bbox, poss,input_query_label,attn_mask)
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in call_impl
result = self.forward(*input, **kwargs)
File "/workspace/cbn/DINO/models/dino/deformable_transformer.py", line 343, in forward
output_memory, output_proposals = gen_encoder_output_proposals(memory, mask_flatten, spatial_shapes, input_hw)
File "/workspace/cbn/DINO/models/dino/utils.py", line 31, in gen_encoder_output_proposals
mask_flatten = memory_padding_mask[:, cur:(cur + H * W)].view(N, H, W_, 1)
RuntimeError: shape '[8, 92, 92, 1]' is invalid for input of size 33856
/opt/conda/lib/python3.8/site-packages/torch/tensor.py:559: UserWarning: floor_divide is deprecated, and will be removed in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values.
To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). (Triggered internally at ../aten/src/ATen/native/BinaryOps.cpp:335.)
return torch.floor_divide(self, other)
Traceback (most recent call last):
File "main.py", line 423, in
main(args)
File "main.py", line 309, in main
train_stats = train_one_epoch(
File "/workspace/cbn/DINO/engine.py", line 48, in train_one_epoch
outputs = model(samples, targets)
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in call_impl
result = self.forward(*input, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/torch/nn/parallel/distributed.py", line 707, in forward
output = self.module(*inputs[0], **kwargs[0])
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in call_impl
result = self.forward(*input, **kwargs)
File "/workspace/cbn/DINO/models/dino/dino.py", line 270, in forward
hs, reference, hs_enc, ref_enc, init_box_proposal = self.transformer(srcs, masks, input_query_bbox, poss,input_query_label,attn_mask)
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in call_impl
result = self.forward(*input, **kwargs)
File "/workspace/cbn/DINO/models/dino/deformable_transformer.py", line 343, in forward
output_memory, output_proposals = gen_encoder_output_proposals(memory, mask_flatten, spatial_shapes, input_hw)
File "/workspace/cbn/DINO/models/dino/utils.py", line 31, in gen_encoder_output_proposals
mask_flatten = memory_padding_mask[:, cur:(cur + H * W)].view(N, H, W_, 1)
RuntimeError: shape '[8, 139, 96, 1]' is invalid for input of size 53376
The text was updated successfully, but these errors were encountered: