Skip to content

Commit 66ff4a4

Browse files
committed
upload pytorch weights and fix detach bug
1 parent 8a1b85a commit 66ff4a4

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

rtdetr_pytorch/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
- [x] Evaluation
44
- [x] Export onnx
55
- [x] Upload source code
6-
- [ ] Align with the [Paddle version](../rtdetr_paddle/)
7-
- [ ] Upload weight convert from paddle
6+
- [x] Upload weight convert from paddle, see [links](https://github.com/lyuwenyu/RT-DETR/issues/42)
7+
- [ ] Align training with the [paddle version](../rtdetr_paddle/)
88

99

1010
## Quick start
1111

12-
<details open>
12+
<details>
1313
<summary>Install</summary>
1414

1515
```bash
@@ -76,9 +76,9 @@ python tools/export_onnx.py -c configs/rtdetr/rtdetr_r18vd_6x_coco.yml -r path/t
7676

7777

7878

79-
<details>
80-
<summary>Finetune</summary>
79+
<details open>
80+
<summary>Train custom data</summary>
8181

82-
Set `remap_mscoco_category: False`. This var only works for ms-coco dataset.
82+
set `remap_mscoco_category: False`. This variable only works for ms-coco dataset.
8383

8484
</details>

rtdetr_pytorch/src/zoo/rtdetr/rtdetr_decoder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,11 +507,12 @@ def _get_decoder_input(self,
507507
else:
508508
target = output_memory.gather(dim=1, \
509509
index=topk_ind.unsqueeze(-1).repeat(1, 1, output_memory.shape[-1]))
510+
target = target.detach()
510511

511512
if denoising_class is not None:
512513
target = torch.concat([denoising_class, target], 1)
513514

514-
return target.detach(), reference_points_unact.detach(), enc_topk_bboxes, enc_topk_logits
515+
return target, reference_points_unact.detach(), enc_topk_bboxes, enc_topk_logits
515516

516517

517518
def forward(self, feats, targets=None):

0 commit comments

Comments
 (0)