Open cbn3 opened 1 year ago
Do you set the value of N to 8? it might be 4.
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?
Traceback (most recent call last):
File "main.py", line 424, in
N in This line
mask_flatten = memory_padding_mask[:, cur:(cur + H * W)].view(N, H, W_, 1)
N in This line
mask_flatten = memory_padding_mask[:, cur:(cur + H * W)].view(N, H, W_, 1)
Sorry to bother you.When I add default=[] to the parameter insert_idx and run main.py without assigning insert_idx a value of 0, the initial error is not reported. However, in this case, has batchformerv2 been successfully added to the model?
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
maskflatten = 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
maskflatten = 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