Hi, I'm trying to run the pretraining but I receive a mismatch size here https://github.com/amirbar/DETReg/blob/main/models/deformable_detr.py#L328, src_features has a shape of torch.Size([228, 512]) and target_features a shape of torch.Size([228, 3, 128, 128]). Is this ok?
Start training
/home/jossalgon/my-envs/detreg/lib/python3.7/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /opt/conda/conda-bld/pytorch_1623448265233/work/c10/core/TensorImpl.h:1156.)
return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)
/home/jossalgon/my-envs/detreg/lib/python3.7/site-packages/torch/_tensor.py:575: 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 /opt/conda/conda-bld/pytorch_1623448265233/work/aten/src/ATen/native/BinaryOps.cpp:467.)
return torch.floor_divide(self, other)
/home/jossalgon/notebooks/unsupervised/DETReg/models/deformable_detr.py:329: UserWarning: Using a target size (torch.Size([228, 3, 128, 128])) that is different to the input size (torch.Size([228, 512])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
return {'object_embedding_loss': torch.nn.functional.l1_loss(src_features, target_features, reduction='mean')}
Traceback (most recent call last):
File "main.py", line 403, in
main(args)
File "main.py", line 314, in main
model, swav_model, criterion, data_loader_train, optimizer, device, epoch, args.clip_max_norm)
File "/home/jossalgon/notebooks/unsupervised/DETReg/engine.py", line 50, in train_one_epoch
loss_dict = criterion(outputs, targets)
File "/home/jossalgon/my-envs/detreg/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/home/jossalgon/notebooks/unsupervised/DETReg/models/deformable_detr.py", line 406, in forward
losses.update(self.get_loss(loss, outputs, targets, indices, num_boxes, **kwargs))
File "/home/jossalgon/notebooks/unsupervised/DETReg/models/deformable_detr.py", line 381, in get_loss
return loss_map[loss](outputs, targets, indices, num_boxes, **kwargs)
File "/home/jossalgon/notebooks/unsupervised/DETReg/models/deformable_detr.py", line 329, in loss_object_embedding_loss
return {'object_embedding_loss': torch.nn.functional.l1_loss(src_features, target_features, reduction='mean')}
File "/home/jossalgon/my-envs/detreg/lib/python3.7/site-packages/torch/nn/functional.py", line 3058, in l1_loss
expanded_input, expanded_target = torch.broadcast_tensors(input, target)
File "/home/jossalgon/my-envs/detreg/lib/python3.7/site-packages/torch/functional.py", line 73, in broadcast_tensors
return _VF.broadcast_tensors(tensors) # type: ignore[attr-defined]
RuntimeError: The size of tensor a (512) must match the size of tensor b (128) at non-singleton dimension 3
Traceback (most recent call last):
File "./tools/launch.py", line 192, in
main()
File "./tools/launch.py", line 188, in main
cmd=process.args)
Using:
cudatoolkit 11.1.74 h6bb024c_0 nvidia/linux-64
pytorch 1.9.0 py3.7_cuda11.1_cudnn8.0.5_0 pytorch/linux-64
torchaudio 0.9.0 py37 pytorch/linux-64
torchvision 0.10.0 py37_cu111 pytorch/linux-64
Thanks and great work!