PINTO0309 / PINTO_model_zoo

A repository for storing models that have been inter-converted between various frameworks. Supported frameworks are TensorFlow, PyTorch, ONNX, OpenVINO, TFJS, TFTRT, TensorFlowLite (Float32/16/INT8), EdgeTPU, CoreML.
https://qiita.com/PINTO
MIT License
3.43k stars 560 forks source link

425_Gold-YOLO-Body-Head-Hand cannnot execute demo_goldyolo_onnx_image.py #412

Closed h-nakagawa-ykc closed 1 month ago

h-nakagawa-ykc commented 1 month ago

Issue Type

Support

OS

Ubuntu

OS architecture

aarch64

Programming Language

Python

Framework

ONNX

Model name and Weights/Checkpoints URL

https://s3.ap-northeast-2.wasabisys.com/pinto-model-zoo/425_Gold-YOLO-Body-Head-Hand/resources_n.tar.gz

Description

According to the README.md, the following error message appears when running. I wondered if you could help me. Thank you very much!

Relevant Log Output

/opt/conda/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py:69: UserWarning: Specified provider 'TensorrtExecutionProvider' is not in available provider names.Available providers: 'AzureExecutionProvider, CPUExecutionProvider'
  warnings.warn(
/opt/conda/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py:69: UserWarning: Specified provider 'CUDAExecutionProvider' is not in available provider names.Available providers: 'AzureExecutionProvider, CPUExecutionProvider'
  warnings.warn(
  0%|                                                                                                                                                                                              | 0/2 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "demo_goldyolo_onnx_image.py", line 323, in <module>
    main()
  File "demo_goldyolo_onnx_image.py", line 263, in main
    boxes, scores = model(debug_image)
  File "demo_goldyolo_onnx_image.py", line 115, in __call__
    self.__postprocess(
  File "demo_goldyolo_onnx_image.py", line 202, in __postprocess
    scores_keep = scores[keep_idxs, :]
IndexError: boolean index did not match indexed array along dimension 1; dimension is 1 but corresponding boolean dimension is 8

URL or source code for simple inference testing code

I executed the following command to download the model before executing the program.

pip install onnxruntime
pip install opencv-python
wget https://raw.githubusercontent.com/PINTO0309/PINTO_model_zoo/main/425_Gold-YOLO-Body-Head-Hand/demo/demo_goldyolo_onnx.py
wget https://raw.githubusercontent.com/PINTO0309/PINTO_model_zoo/main/425_Gold-YOLO-Body-Head-Hand/download_n.sh
bash download_n.sh

The execution command follows.

python demo/demo_goldyolo_onnx_image.py \
-m gold_yolo_n_body_head_hand_post_0461_0.4428_1x3x480x640.onnx \
-i images_folder

I used “bus.jpg” and “zidane.jpg” from the following link as input images. https://github.com/ultralytics/yolov5/tree/master/data/images

PINTO0309 commented 1 month ago
python -V
Python 3.10.12

pip show onnx onnxruntime-gpu 
Name: onnx
Version: 1.16.0
Summary: Open Neural Network Exchange
Home-page: 
Author: 
Author-email: ONNX Contributors <onnx-technical-discuss@lists.lfaidata.foundation>
License: Apache License v2.0
Location: /home/xxxx/.local/lib/python3.10/site-packages
Requires: numpy, protobuf
Required-by: insightface, onnx-graphsurgeon, onnx-tensorrt, onnxscript, onnxsim, super-gradients, tf2onnx
---
Name: onnxruntime-gpu
Version: 1.17.1
Summary: ONNX Runtime is a runtime accelerator for Machine Learning models
Home-page: https://onnxruntime.ai
Author: Microsoft Corporation
Author-email: onnxruntime@microsoft.com
License: MIT License
Location: /home/xxxx/.local/lib/python3.10/site-packages
Requires: coloredlogs, flatbuffers, numpy, packaging, protobuf, sympy
Required-by: 
python demo/demo_goldyolo_onnx_image.py
-m gold_yolo_n_body_head_hand_post_0461_0.4428_1x3x480x640.onnx \
-i images_folder

bus