新人跑例子遇到了点问题,希望有大佬闲暇帮忙指点一下,小白不胜感激,提前谢过。
问题表述:
小白想在本地的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文件都是网上找的,没有自己标注,没做转换 想先跑一下,但是出了点问题)。
希望得到一些帮助。多谢大佬们了,
啊,我找到原因了,是因为在之前配置环境的时候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盘了。这样输入训练指令才能进行训练。
你好,我也遇到了一样的错误,您说的cocoapi是什么,可以说的具体一点吗,谢谢
你好,请问解决了吗?
你好我的情况和楼主一样。请问您是怎么解决的?
这个应该去coco.py文件里排查问题。我的问题是在旋转检测问题中,bbox是空的,所以代码就报错了,我把那行检查去掉就好了。