Skip to content

Error reporting issue when adding batchformerv2 to other class detr models #26

Description

@cbn3

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions