i add a main to the deformable_transformer.py ,and use right shape of the input. When i test the transformer,the follwing are
Traceback (most recent call last):
File "D:\pycharmcode\Lite-DETR-main\models\dino\deformable_transformer.py", line 1339, in
out = model(srcs,masks,refpoint_embed,pos_embeds,tgt)
File "D:\Anaconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "D:\pycharmcode\Lite-DETR-main\models\dino\deformable_transformer.py", line 362, in forward
print(level_start_index[4 - self.enc_scale])
IndexError: index 1 is out of bounds for dimension 0 with size 1
i use enc_scale==3,but the level_start_index shape is torch.Size([1]),so this error happens.
The follwing are my scipts, there is no change in other codes:
i add a main to the deformable_transformer.py ,and use right shape of the input. When i test the transformer,the follwing are
Traceback (most recent call last): File "D:\pycharmcode\Lite-DETR-main\models\dino\deformable_transformer.py", line 1339, in
out = model(srcs,masks,refpoint_embed,pos_embeds,tgt)
File "D:\Anaconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "D:\pycharmcode\Lite-DETR-main\models\dino\deformable_transformer.py", line 362, in forward
print(level_start_index[4 - self.enc_scale])
IndexError: index 1 is out of bounds for dimension 0 with size 1
i use enc_scale==3,but the level_start_index shape is torch.Size([1]),so this error happens. The follwing are my scipts, there is no change in other codes:
def build_my_deformable_transformer(): decoder_query_perturber = None
if name == 'main':
.cuda()
how can i fix it?