PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.68k stars 2.87k forks source link

ppyolo_r在detect时报错 #8338

Open Sweewangyu opened 1 year ago

Sweewangyu commented 1 year ago

问题确认 Search before asking

Bug组件 Bug Component

Validation

Bug描述 Describe the Bug

PS C:\Users\wangyu\PaddleDetection> python tools/infer.py -c configs/rotate/ppyoloe_r/ppyoloe_r_crn_x_3x_dota.yml -o weights=output/ppyoloe_r_crn_x_3x_dota/model_final.pdparams --infer_dir dataset/dota/test1/ --save_results True --ou tput_dir=results W0609 09:08:55.208385 65948 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 11.5, Runtime API Version: 11.6 W0609 09:08:55.214391 65948 gpu_resources.cc:91] device: 0, cuDNN Version: 8.2. W0609 09:08:55.214391 65948 gpu_resources.cc:117] WARNING: device: 0. The installed Paddle is compiled with CUDA 11.6, but CUDA runtime version in your machine is 11.5, which may cause serious incompatible bug. Please recompile or re install Paddle with compatible CUDA version. [06/09 09:08:57] ppdet.utils.checkpoint INFO: Finish loading model weights: output/ppyoloe_r_crn_x_3x_dota/model_final.pdparams [06/09 09:08:57] train INFO: Found 3000 inference images in total. [06/09 09:08:57] ppdet.data.source.category WARNING: anno_file 'dataset/dota/test/DOTA_trainval1024.json' is None or not set or not exist, please recheck TrainDataset/EvalDataset/TestDataset.anno_path, otherwise the default categorie s will be used by metric_type. [06/09 09:08:57] ppdet.data.source.category WARNING: metric_type: RBOX, load default categories of DOTA. [06/09 09:08:57] ppdet.data.source.category WARNING: anno_file 'dataset/dota/test/DOTA_trainval1024.json' is None or not set or not exist, please recheck TrainDataset/EvalDataset/TestDataset.anno_path, otherwise the default categorie s will be used by metric_type. [06/09 09:08:57] ppdet.data.source.category WARNING: metric_type: RBOX, load default categories of DOTA. 0%| | 0/1500 [00:00<?, ?it/s]W 0609 09:08:58.134686 65948 gpu_resources.cc:217] WARNING: device: . The installed Paddle is compiled with CUDNN 8.4, but CUDNN version in your machine is 8.2, which may cause serious incompatible bug. Please recompile or reinstall Pa ddle with compatible CUDNN version. 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1500/1500 [03:05<00:00, 8.07it/s] Traceback (most recent call last): File "C:\Users\wangyu\PaddleDetection\tools\infer.py", line 236, in main() File "C:\Users\wangyu\PaddleDetection\tools\infer.py", line 232, in main run(FLAGS, cfg) File "C:\Users\wangyu\PaddleDetection\tools\infer.py", line 182, in run trainer.predict( File "C:\Users\wangyu\PaddleDetection\ppdet\engine\trainer.py", line 1006, in predict _m.accumulate() File "C:\Users\wangyu\PaddleDetection\ppdet\metrics\metrics.py", line 457, in accumulate self.save_results(self.results, self.output_eval, self.imid2path) File "C:\Users\wangyu\PaddleDetection\ppdet\metrics\metrics.py", line 442, in save_results bbox_pred = '{} {} '.format(self.catid2name[catid], KeyError: 18

复现环境 Environment

操作系统:windows paddle 2.4 paddledeticion 2.6 cuda 11.6 cudnn 8.2

Bug描述确认 Bug description confirmation

是否愿意提交PR? Are you willing to submit a PR?

Sweewangyu commented 1 year ago

这个错误他只会输出一张图片的预测,而且预测的类并不是我数据集的: ground-track-field 0.18453751504421234 720.5169067382812 506.9333190917969 707.2941284179688 441.8536071777344 768.9458618164062 429.3273010253906 782.1686401367188 494.4070129394531 ground-track-field 0.18268121778964996 791.6771850585938 491.42462158203125 779.7164916992188 425.76226806640625 841.8723754882812 414.44024658203125 853.8330688476562 480.10260009765625 ground-track-field 0.16900712251663208 654.86669921875 519.047607421875 644.1883544921875 453.89129638671875 707.6962890625 443.483154296875 718.3746337890625 508.6394958496094 ground-track-field 0.11428007483482361 926.4198608398438 461.674072265625 914.1167602539062 397.177978515625 975.5823364257812 385.4530029296875 987.8854370117188 449.9490966796875 ground-track-field 0.10431606322526932 855.4425659179688 477.6036071777344 841.8840942382812 414.0150451660156 903.3235473632812 400.9148254394531 916.8820190429688 464.5033874511719 small-vehicle 0.1274353265762329 654.86669921875 519.047607421875 644.1883544921875 453.89129638671875 707.6962890625 443.483154296875 718.3746337890625 508.6394958496094 small-vehicle 0.12140067666769028 791.8585205078125 491.9017028808594 780.028076171875 425.7395935058594 841.838134765625 414.6872863769531 853.6685791015625 480.8493957519531 storage-tank 0.4494267702102661 654.86669921875 519.047607421875 644.1883544921875 453.89129638671875 707.6962890625 443.483154296875 718.3746337890625 508.6394958496094 storage-tank 0.277788907289505 720.5169067382812 506.9333190917969 707.2941284179688 441.8536071777344 768.9458618164062 429.3273010253906 782.1686401367188 494.4070129394531 storage-tank 0.2607254385948181 791.6771850585938 491.42462158203125 779.7164916992188 425.76226806640625 841.8723754882812 414.44024658203125 853.8330688476562 480.10260009765625 storage-tank 0.22612980008125305 925.4138793945312 461.5453796386719 913.5693969726562 396.9386901855469 976.3895874023438 385.4217834472656 988.2340698242188 450.0284729003906 storage-tank 0.15311157703399658 855.4425659179688 477.6036071777344 841.8840942382812 414.0150451660156 903.3235473632812 400.9148254394531 916.8820190429688 464.5033874511719 harbor 0.29641425609588623 290.6708679199219 835.7395629882812 257.1517028808594 817.0376586914062 283.5365295410156 769.7484741210938 317.0556945800781 788.4503784179688 helicopter 0.10694608837366104 856.91943359375 477.5010986328125 842.9434814453125 414.39691162109375 902.44482421875 401.21893310546875 916.4207763671875 464.3231201171875