Epiphqny/VisTR

the VisTR'forward output doesn't match the code in inference.py

9p15p opened this issue · 1 comments

9p15p commented

error is here:

ssh://reid@10.7.47.204:22/home/reid/anaconda3/envs/vistr/bin/python -u /home/reid/ldz_project/vistr/inference.py --model_path ckpt/vistr_r101.pth
Process video:  0
Traceback (most recent call last):
  File "/home/reid/ldz_project/vistr/inference.py", line 244, in <module>
    main(args)
  File "/home/reid/ldz_project/vistr/inference.py", line 209, in main
    logits, boxes, masks = outputs['pred_logits'].softmax(-1)[0,:,:-1], outputs['pred_boxes'][0], outputs['pred_masks'][0]
KeyError: 'pred_masks'

Process finished with exit code 1

the code in VisTR

def forward(self, samples: NestedTensor):
        ...
        out = {'pred_logits': outputs_class[-1], 'pred_boxes': outputs_coord[-1]}
        if self.aux_loss:
            out['aux_outputs'] = self._set_aux_loss(outputs_class, outputs_coord)
        return out

the code in inference.py:

# inference time is calculated for this operation
outputs = model(img)
# end of model inference
logits, boxes, masks = outputs['pred_logits'].softmax(-1)[0,:,:-1], outputs['pred_boxes'][0], outputs['pred_masks'][0]
9p15p commented

It seems that I forget use --masks in args.