alexppppp / keypoint_rcnn_training_pytorch

How to Train a Custom Keypoint Detection Model with PyTorch (Article on Medium)
https://medium.com/@alexppppp/how-to-train-a-custom-keypoint-detection-model-with-pytorch-d9af90e111da
MIT License
81 stars 31 forks source link

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

Open xiaoLiu0531 opened 2 years ago

xiaoLiu0531 commented 2 years ago

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'