本文主要是介绍PaddleDetection使用问题01_COCODataSet_object_has_no_attribute,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1 问题
Traceback (most recent call last):File "tools/infer.py", line 177, in <module>main()File "tools/infer.py", line 173, in mainrun(FLAGS, cfg)File "tools/infer.py", line 134, in runsave_txt=FLAGS.save_txt)File "/home/zhangxin/github/PaddleDetection/ppdet/engine/trainer.py", line 541, in predictself.dataset.set_images(images)
AttributeError: 'COCODataSet' object has no attribute 'set_images'
2 解决办法:
错误原因是TestDataset配置错了,在改配置文件时把ImageFolder错改成了COCODataSet。
metric: COCO
num_classes: 80TrainDataset:!COCODataSetimage_dir: train2017anno_path: annotations/instances_train2017.jsondataset_dir: dataset/cocodata_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']EvalDataset:!COCODataSetimage_dir: val2017anno_path: annotations/instances_val2017.jsondataset_dir: dataset/cocoTestDataset:!ImageFolderanno_path: annotations/instances_val2017.jsondataset_dir: dataset/coco
这篇关于PaddleDetection使用问题01_COCODataSet_object_has_no_attribute的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!