Skip to content

I met a error when train with this code. #7

@xiaoLiu0531

Description

@xiaoLiu0531

I used glue datasets and custom datasets ,but met the same question:
File "D:/program/keypoint_rcnn_training_pytorch-main/trainer.py", line 164, in
train_one_epoch(model, optimizer, data_loader_train, device, epoch, print_freq=1000)
File "D:\program\keypoint_rcnn_training_pytorch-main\engine.py", line 31, in train_one_epoch
loss_dict = model(images, targets)
File "E:\python38\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "E:\python38\lib\site-packages\torchvision\models\detection\generalized_rcnn.py", line 99, in forward
detections, detector_losses = self.roi_heads(features, proposals, images.image_sizes, targets)
File "E:\python38\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "E:\python38\lib\site-packages\torchvision\models\detection\roi_heads.py", line 740, in forward
assert t["labels"].dtype == torch.int64, "target labels must of int64 type"
KeyError: 'labels'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions