PaddleDetection icon indicating copy to clipboard operation
PaddleDetection copied to clipboard

python部署推理结果为空

Open LittleCool-Man opened this issue 1 year ago • 8 comments

问题确认 Search before asking

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

请提出你的问题 Please ask your question

运行环境: paddlepaddle:2.6.1 paddledetection:2.7 预训练模型:picodet_s_416_coco_npu.pdparams 模型训练完成后调用tools/infer.py推理正常,导出模型后,调用delopy/python/infer.py推理后,保存的图标无推理结果; 执行命令python PaddleDetection/tools/train.py -c PaddleDetection/configs/picodet/picodet_s_416_voc_npu.yml --amp训练模型 执行命令python tools/export_model.py -c configs/picodet/picodet_s_416_voc_npu.yml -o weights=../pretained_model/picodet_s_416_coco_npu.pdparams TestReader.inputs_def.image_shape=[3,416,416] --output_dir ../output_inference/picodet_s_416_voc_npu/导出模型; 执行命令python PaddleDetection/deploy/python/infer.py --model_dir output_inference/picodet_s_416_voc_npu --image_dir data/jpg/使用导出模型推理。 tools/infer.py推理结果: helmet00100 deploy/python/infer.py推理结果: helmet00100

LittleCool-Man avatar Aug 05 '24 09:08 LittleCool-Man

您好,请问模型导出是否成功了?如果使用https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.7/configs/picodet 这里面提供的官方导出模型,是否正常呢?

Sunting78 avatar Aug 06 '24 11:08 Sunting78

您好,请问模型导出是否成功了?如果使用 https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.7/configs/picodet 这里面提供的官方导出模型,是否正常呢?

使用的是PicoDet-S-NPU模型,导出模型时正常无报错,调用deploy/python/infer.py使用导出模型推理时,也无报错。 ----------- Running Arguments ----------- action_file: None batch_size: 1 camera_id: -1 combine_method: nms cpu_threads: 1 device: cpu enable_mkldnn: False enable_mkldnn_bfloat16: False image_dir: work/ image_file: None match_metric: ios match_threshold: 0.6 model_dir: ./output_inference/picodet_s_416_voc_npu/ output_dir: output overlap_ratio: [0.25, 0.25] random_pad: False reid_batch_size: 50 reid_model_dir: None run_benchmark: False run_mode: paddle save_images: True save_mot_txt_per_img: False save_mot_txts: False save_results: False scaled: False slice_infer: False slice_size: [640, 640] threshold: 0.5 tracker_config: None trt_calib_mode: False trt_max_shape: 1280 trt_min_shape: 1 trt_opt_shape: 640 use_coco_category: False use_dark: True use_gpu: False video_file: None window_size: 50

----------- Model Configuration ----------- Model Arch: GFL Transform Order: --transform op: Resize --transform op: NormalizeImage --transform op: Permute

Found 34 inference images in total. save result to: output/123.jpg Test iter 0 save result to: output/xianchang0012.jpg Test iter 1 save result to: output/xianchang0029.jpg Test iter 2 save result to: output/xianchang0026.jpg Test iter 3 save result to: output/xianchang0004.jpg Test iter 4 save result to: output/xianchang0013.jpg Test iter 5 save result to: output/xianchang0018.jpg Test iter 6 save result to: output/xianchang0065.jpg Test iter 7 save result to: output/12345.jpg Test iter 8 save result to: output/xianchang0011.jpg Test iter 9 save result to: output/xianchang0069.jpg Test iter 10 save result to: output/xianchang0064.jpg Test iter 11 save result to: output/xianchang0023.jpg Test iter 12 save result to: output/xianchang0003.jpg Test iter 13 save result to: output/xianchang0068.jpg Test iter 14 save result to: output/xianchang0025.jpg Test iter 15 save result to: output/xianchang0007.jpg Test iter 16 save result to: output/xianchang0024.jpg Test iter 17 save result to: output/xianchang0028.jpg Test iter 18 save result to: output/xianchang0010.jpg Test iter 19 save result to: output/xianchang0021.jpg Test iter 20 save result to: output/xianchang0022.jpg Test iter 21 save result to: output/xianchang0008.jpg Test iter 22 save result to: output/xianchang0009.jpg Test iter 23 save result to: output/xianchang0005.jpg Test iter 24 save result to: output/xianchang0019.jpg Test iter 25 save result to: output/xianchang0014.jpg Test iter 26 save result to: output/xianchang0067.jpg Test iter 27 save result to: output/xianchang0066.jpg Test iter 28 save result to: output/xianchang0020.jpg Test iter 29 save result to: output/1234.jpg Test iter 30 save result to: output/xianchang0015.jpg Test iter 31 save result to: output/xianchang0006.jpg Test iter 32 save result to: output/xianchang0002.jpg Test iter 33 ------------------ Inference Time Info ---------------------- total_time(ms): 10398.6, img_num: 34 average latency time(ms): 305.84, QPS: 3.269671 preprocess_time(ms): 133.40, inference_time(ms): 172.50, postprocess_time(ms): 0.00 打开保存的图片时,无任何识别框。

LittleCool-Man avatar Aug 07 '24 02:08 LittleCool-Man

TestReader.inputs_def.image_shape=[3,416,416] 执行的时候把这个去掉 再重新导出一下

Sunting78 avatar Aug 07 '24 12:08 Sunting78

TestReader.inputs_def.image_shape=[3,416,416] 执行的时候把这个去掉 再重新导出一下

去掉了结果还是一样。我在aistudio上新建了环境(paddlepaddle:2.4.0 paddledetection:2.6),重新训练,导出了epoch49的模型,deploy/python/infer.py推理图片正常。今天使用命令python PaddleDetection/tools/train.py -c PaddleDetection/configs/picodet/picodet_s_416_voc_npu.yml -r output/149继续训练,导出epoch229的模型,deploy/python/infer.py推理图片结果又为空了,重新导出了epoch49的模型,推理结果也是空。 昨天执行了pip -r requirements.txtpython setup.py install,今天进入situdio环境时,执行pip list,未看到paddledet包,但是训练模型、导出模型、预测图片(tools/infer.py)这些都是正常无报错。这是有可能是导致导出的模型推理结果为空的原因吗?训练模型、导出模型、预测图片(tools/infer.py)都未使用paddledet,但是deploy/python/infer.py调用了paddledet吗?

LittleCool-Man avatar Aug 08 '24 07:08 LittleCool-Man

你自己git clone了paddledetection,之后执行了pip -r requirements.txt和python setup.py install吗?如果没有选分枝,就会默认主分枝。看你的情况paddlepaddle:2.4.0和paddledetection:2.6应该是正常的。可以选择2.6分枝

Sunting78 avatar Aug 08 '24 12:08 Sunting78

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


From Bot

TingquanGao avatar Aug 17 '24 02:08 TingquanGao

问题确认 Search before asking

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

请提出你的问题 Please ask your question

运行环境: paddlepaddle:2.6.1 paddledetection:2.7 预训练模型:picodet_s_416_coco_npu.pdparams 模型训练完成后调用tools/infer.py推理正常,导出模型后,调用delopy/python/infer.py推理后,保存的图标无推理结果; 执行命令python PaddleDetection/tools/train.py -c PaddleDetection/configs/picodet/picodet_s_416_voc_npu.yml --amp训练模型 执行命令python tools/export_model.py -c configs/picodet/picodet_s_416_voc_npu.yml -o weights=../pretained_model/picodet_s_416_coco_npu.pdparams TestReader.inputs_def.image_shape=[3,416,416] --output_dir ../output_inference/picodet_s_416_voc_npu/导出模型; 执行命令python PaddleDetection/deploy/python/infer.py --model_dir output_inference/picodet_s_416_voc_npu --image_dir data/jpg/使用导出模型推理。 tools/infer.py推理结果: helmet00100 deploy/python/infer.py推理结果: helmet00100

你好,你的运行环境是以下配置,想问一下detection的安装包时lap安装时搭配的numpy的包的版本是多少?还需要调整哪些包才能完成安装,我们在安装detection的依赖包时出现错误。

运行环境: paddlepaddle:2.6.1 paddledetection:2.7

BotAndyGao avatar Aug 23 '24 07:08 BotAndyGao

具体安装报错是什么呢?可以发出来看下。numpy < 1.24 按照requirements.txt安装即可

Sunting78 avatar Aug 29 '24 12:08 Sunting78

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


From Bot

TingquanGao avatar Sep 30 '24 03:09 TingquanGao