PaddlePaddle / PaddleYOLO

🚀🚀🚀 YOLO series of PaddlePaddle implementation, PP-YOLOE+, RT-DETR, YOLOv5, YOLOv6, YOLOv7, YOLOv8, YOLOv10, YOLOX, YOLOv5u, YOLOv7u, YOLOv6Lite, RTMDet and so on. 🚀🚀🚀
https://github.com/PaddlePaddle/PaddleYOLO
GNU General Public License v3.0
547 stars 133 forks source link

自定义数据集coco,用yolov5p6_l_300e_coco或者_x,_m等模型训练报错! #140

Closed Grubby-Wang closed 1 year ago

Grubby-Wang commented 1 year ago

问题确认 Search before asking

请提出你的问题 Please ask your question

使用自定义coco数据集,BML CodeLab训练yolov5p6_l_300e_coco等报错!

报错出在../yolov5_loss.py", line 237, in build_targets_paddle
    gt_nums = targets['pad_gt_mask'].sum(1).squeeze(-1)

LAUNCH INFO 2023-05-21 00:45:08,423 ------------------------- ERROR LOG DETAIL ------------------------- Warning: import ppdet from source directory without installing, run 'python setup.py install' to install ppdet firstly loading annotations into memory... Done (t=0.18s) creating index... index created! [05/21 00:44:56] ppdet.data.source.coco INFO: Load [166 samples valid, 0 samples invalid] in file dataset/coco/Annotations/train.json. W0521 00:44:57.043891 2118 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.2, Runtime API Version: 11.2 W0521 00:44:57.053210 2118 gpu_resources.cc:91] device: 0, cuDNN Version: 8.2. Traceback (most recent call last): File "tools/train.py", line 188, in main() File "tools/train.py", line 184, in main run(FLAGS, cfg) File "tools/train.py", line 137, in run trainer.train(FLAGS.eval) File "/home/aistudio/work/PaddleYOLO-develop/ppdet/engine/trainer.py", line 424, in train outputs = model(data) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 948, in call return self.forward(*inputs, kwargs) File "/home/aistudio/work/PaddleYOLO-develop/ppdet/modeling/architectures/meta_arch.py", line 59, in forward out = self.get_loss() File "/home/aistudio/work/PaddleYOLO-develop/ppdet/modeling/architectures/yolov5.py", line 95, in get_loss return self._forward() File "/home/aistudio/work/PaddleYOLO-develop/ppdet/modeling/architectures/yolov5.py", line 77, in _forward yolo_losses = self.yolo_head(neck_feats, self.inputs) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 948, in call return self.forward(*inputs, *kwargs) File "/home/aistudio/work/PaddleYOLO-develop/ppdet/modeling/heads/yolov5_head.py", line 132, in forward return self.loss(yolo_outputs, targets, self.anchors) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 948, in call return self.forward(inputs, kwargs) File "/home/aistudio/work/PaddleYOLO-develop/ppdet/modeling/losses/yolov5_loss.py", line 202, in forward anchors) File "/home/aistudio/work/PaddleYOLO-develop/ppdet/modeling/losses/yolov5_loss.py", line 237, in build_targets_paddle gt_nums = targets['pad_gt_mask'].sum(1).squeeze(-1) KeyError: 'pad_gt_mask' LAUNCH INFO 2023-05-21 00:45:08,423 Exit code 1

复现环境 Environment

OS: windos PaddlePaddle-gpu: 2.4.0.post112 PaddleYolo: develop Python 3.7.0 CUDA: 11.2 CUDNN: 8.2

nemonameless commented 1 year ago

已修复