PaddleDetection icon indicating copy to clipboard operation
PaddleDetection copied to clipboard

快速体验中 infer.py 报错,缺少json文件

Open EvW1998 opened this issue 2 years ago • 8 comments

问题确认 Search before asking

  • [X] 我已经搜索过问题,但是没有找到解答。I have searched the question and found no related answer.

请提出你的问题 Please ask your question

我在运行快速体验中的推理代码 python tools/infer.py -c configs/ppyolo/ppyolo_r50vd_dcn_1x_coco.yml -o use_gpu=true weights=https://paddledet.bj.bcebos.com/models/ppyolo_r50vd_dcn_1x_coco.pdparams --infer_img=demo/000000014439.jpg 时发生了错误。

提示No such file or directory: 'dataset/coco/annotations/instances_val2017.json'

为什么推理还需要下载标注文件呢?

EvW1998 avatar Oct 24 '24 06:10 EvW1998

我也遇到了同样的问题,然后自己下载一个json文件放在那里就好了,官方文档确实不太友好

masiqi avatar Oct 27 '24 14:10 masiqi

而且,TMD,直接运行train 也不行,需要自己手动下载dota 或者coco数据集放在那里,我都无法快速验证配的环境能不能训练和导出

Metavers1 avatar Nov 01 '24 02:11 Metavers1

可以参考 masiqi 的解决方法,也可以尝试使用PaddleX进行单图推理,相关的使用说明在这里~目标检测模型,目标检测产线

zhang-prog avatar Nov 01 '24 03:11 zhang-prog

我也遇到了同样的问题,然后自己下载一个json文件放在那里就好了,官方文档确实不太友好

请问下载链接是什么?在哪能看到?

DazzlingGalaxy avatar Nov 04 '24 07:11 DazzlingGalaxy

我也遇到了同样的问题,然后自己下载一个json文件放在那里就好了,官方文档确实不太友好

请问下载链接是什么?在哪能看到?

instances_val2017.json 应该是这个,你随便跟网上的开源数据集平台上找也能找到的

masiqi avatar Nov 05 '24 15:11 masiqi

我也遇到了同样的问题,然后自己下载一个json文件放在那里就好了,官方文档确实不太友好

请问下载链接是什么?在哪能看到?

instances_val2017.json 应该是这个,你随便跟网上的开源数据集平台上找也能找到的

谢谢,可以了。 我在configs/ppyolo/ppyolo_r50vd_dcn_1x_coco.yml看到

_BASE_: [
  '../datasets/coco_detection.yml',
  '../runtime.yml',
  './_base_/ppyolo_r50vd_dcn.yml',
  './_base_/optimizer_1x.yml',
  './_base_/ppyolo_reader.yml',
]

snapshot_epoch: 16
weights: output/ppyolo_r50vd_dcn_1x_coco/model_final

然后去../datasets/coco_detection.yml中看到

metric: COCO
num_classes: 80

TrainDataset:
  name: COCODataSet
  image_dir: train2017
  anno_path: annotations/instances_train2017.json
  dataset_dir: dataset/coco
  data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']

EvalDataset:
  name: COCODataSet
  image_dir: val2017
  anno_path: annotations/instances_val2017.json
  dataset_dir: dataset/coco
  allow_empty: true

TestDataset:
  name: ImageFolder
  anno_path: annotations/instances_val2017.json # also support txt (like VOC's label_list.txt)
  dataset_dir: dataset/coco # if set, anno_path will be 'dataset_dir/anno_path'

原来是在这里用了instances_train2017.json,你说可以在开源数据集平台上能找到,是Hugging Face或魔搭吗(我是新手,只知道这两个,还是说还有其他的)?我在这里看到了annotations_trainval2017.zip,下载后里面有instances_train2017.json,也可以用,但比你的大得多,有什么区别?

DazzlingGalaxy avatar Nov 06 '24 02:11 DazzlingGalaxy

我也遇到了同样的问题,然后自己下载一个json文件放在那里就好了,官方文档确实不太友好

请问下载链接是什么?在哪能看到?

instances_val2017.json 应该是这个,你随便跟网上的开源数据集平台上找也能找到的

谢谢,可以了。 我在configs/ppyolo/ppyolo_r50vd_dcn_1x_coco.yml看到

_BASE_: [
  '../datasets/coco_detection.yml',
  '../runtime.yml',
  './_base_/ppyolo_r50vd_dcn.yml',
  './_base_/optimizer_1x.yml',
  './_base_/ppyolo_reader.yml',
]

snapshot_epoch: 16
weights: output/ppyolo_r50vd_dcn_1x_coco/model_final

然后去../datasets/coco_detection.yml中看到

metric: COCO
num_classes: 80

TrainDataset:
  name: COCODataSet
  image_dir: train2017
  anno_path: annotations/instances_train2017.json
  dataset_dir: dataset/coco
  data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']

EvalDataset:
  name: COCODataSet
  image_dir: val2017
  anno_path: annotations/instances_val2017.json
  dataset_dir: dataset/coco
  allow_empty: true

TestDataset:
  name: ImageFolder
  anno_path: annotations/instances_val2017.json # also support txt (like VOC's label_list.txt)
  dataset_dir: dataset/coco # if set, anno_path will be 'dataset_dir/anno_path'

原来是在这里用了instances_train2017.json,你说可以在开源数据集平台上能找到,是Hugging Face或魔搭吗(我是新手,只知道这两个,还是说还有其他的)?我在这里看到了annotations_trainval2017.zip,下载后里面有instances_train2017.json,也可以用,但比你的大得多,有什么区别?

我也是新手,没有仔细看,我发现它能跑然后就停掉去跑yolov11了

masiqi avatar Nov 06 '24 05:11 masiqi

The issue has no response for a long time and will be closed. You can reopen or new another issue if are still confused.

zhang-prog avatar Nov 15 '24 10:11 zhang-prog