首页 PaddleCV 帖子详情
想用paddledetection训练商超检测数据集coco格式的,训练报错
收藏
快速回复
PaddleCV 问答目标检测 2023 4
想用paddledetection训练商超检测数据集coco格式的,训练报错
收藏
快速回复
PaddleCV 问答目标检测 2023 4

新人跑例子遇到了点问题,希望有大佬闲暇帮忙指点一下,小白不胜感激,提前谢过。

问题表述:

小白想在本地的pycharm中跑商超检测数据集,在ai studio中下载了商超数据集,数据集格式为

coco|train2017||annotations||| instances_train2017.json  ||| instances_val2017.json      

     |train2017||train_image(训练的图片)

     |val2017||val_image(验证的图片)

     |test2017  ||test_image(测试的图片)

 小白目的:  想利用paddledetection中的  yml文件  训练这些数据并且生成模型  做预测,选用了paddledetection/configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.yml文件

训练指令是:python -u tools/train.py -c configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.yml
-o use_gpu=true

并且修改了数据集的路径和json文件路径,和num_classes

之后运行训练指令,后发生,在c盘重新下载了coco数据集(项目是在f盘),等数据集下载之后开始报错。

 

错误类型为:[03/22 19:18:26] ppdet.data.source.coco WARNING: Illegal image file: F:/paddledetection_work3.7.4/PaddleDetection/dataset/coco/train2017/000000575958.jpg, and it will be
ignored
[03/22 19:18:26] ppdet.data.source.coco WARNING: Illegal image file: F:/paddledetection_work3.7.4/PaddleDetection/dataset/coco/train2017/000000575961.jpg, and it will be
ignored
[03/22 19:18:26] ppdet.data.source.coco WARNING: Illegal image file: F:/paddledetection_work3.7.4/PaddleDetection/dataset/coco/train2017/000000575964.jpg, and it will be
ignored
[03/22 19:18:26] ppdet.data.source.coco WARNING: Illegal image file: F:/paddledetection_work3.7.4/PaddleDetection/dataset/coco/train2017/000000575971.jpg, and it will be
ignored
[03/22 19:18:26] ppdet.data.source.coco WARNING: Illegal image file: F:/paddledetection_work3.7.4/PaddleDetection/dataset/coco/train2017/000000575978.jpg, and it will be
ignored
[03/22 19:18:26] ppdet.data.source.coco WARNING: Illegal image file: F:/paddledetection_work3.7.4/PaddleDetection/dataset/coco/train2017/000000575980.jpg, and it will be
ignored
[03/22 19:18:26] ppdet.data.source.coco WARNING: Illegal image file: F:/paddledetection_work3.7.4/PaddleDetection/dataset/coco/train2017/000000575997.jpg, and it will be
ignored
[03/22 19:18:26] ppdet.data.source.coco WARNING: Illegal image file: F:/paddledetection_work3.7.4/PaddleDetection/dataset/coco/train2017/000000576001.jpg, and it will be
ignored
[03/22 19:18:26] ppdet.data.source.coco WARNING: Illegal image file: F:/paddledetection_work3.7.4/PaddleDetection/dataset/coco/train2017/000000576010.jpg, and it will be
ignored
[03/22 19:18:26] ppdet.data.source.coco WARNING: Illegal image file: F:/paddledetection_work3.7.4/PaddleDetection/dataset/coco/train2017/000000576011.jpg, and it will be
ignored
[03/22 19:18:26] ppdet.data.source.coco WARNING: Illegal image file: F:/paddledetection_work3.7.4/PaddleDetection/dataset/coco/train2017/000000576012.jpg, and it will be
ignored
[03/22 19:18:26] ppdet.data.source.coco WARNING: Illegal image file: F:/paddledetection_work3.7.4/PaddleDetection/dataset/coco/train2017/000000576015.jpg, and it will be
ignored

...

...

Traceback (most recent call last):
File "tools/train.py", line 177, in
main()
File "tools/train.py", line 173, in main
run(FLAGS, cfg)
File "tools/train.py", line 118, in run
trainer = Trainer(cfg, mode='train')
File "F:\paddledetection_work3.7.4\PaddleDetection\ppdet\engine\trainer.py", line 77, in __init__
self.dataset, cfg.worker_num)
File "F:\paddledetection_work3.7.4\PaddleDetection\ppdet\data\reader.py", line 163, in __call__
self.dataset.parse_dataset()
File "F:\paddledetection_work3.7.4\PaddleDetection\ppdet\data\source\coco.py", line 244, in parse_dataset
assert ct > 0, 'not found any coco record in %s' % (anno_path)
AssertionError: not found any coco record in C:\Users\tang/.cache/paddle/dataset\coco\annotations/instances_train2017.json

 

尝试解决的方案:换一个yml文件训练coco格式的数据集,同时更改了yml文件中数据集的位置。还是报了和这个一样的错误。用的是F:\paddledetection_work3.7.4\PaddleDetection\configs\ppyolo\ppyolo_r18vd_coco.yml  文件

感觉好像是coco数据集格式的问题,但是具体哪里出了问题,有点不懂(数据集的图片和json文件都是网上找的,没有自己标注,没做转换  想先跑一下,但是出了点问题)。

希望得到一些帮助。多谢大佬们了,

 

0
收藏
回复
全部评论(4)
时间顺序
爱笑的小风呀
#2 回复于2022-03

啊,我找到原因了,是因为在之前配置环境的时候cocoapi安装没有成功,但是我没看出来,以为安装成功了,之后就开始弄了,后来我重新安装了一下cocoapi,之后在跑模型就好了。  对了 我运行的yml文件是这个python tools/train.py -c configs/faster_rcnn/faster_rcnn_r50_f
pn_1x_coco.yml -o use_gpu=true   在运行之前我把coco数据集自动下载的文件都下载到c盘了。这样输入训练指令才能进行训练。

0
回复
7
7775
#3 回复于2022-11

你好,我也遇到了一样的错误,您说的cocoapi是什么,可以说的具体一点吗,谢谢

0
回复
夜残风晨
#4 回复于2024-01
7775 #3
你好,我也遇到了一样的错误,您说的cocoapi是什么,可以说的具体一点吗,谢谢

你好,请问解决了吗?

 

0
回复
AILeeSin
#5 回复于2024-03
你好,请问解决了吗?  

你好我的情况和楼主一样。请问您是怎么解决的?

 

0
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户