Aimol-l / OrtInference

Using OnnxRuntime to inference yolov10,yolov10+SAM ,yolov10+bytetrack and SAM2 by c++ .
MIT License
37 stars 5 forks source link

code fails to run #5

Open antithing opened 1 day ago

antithing commented 1 day ago

Hi, and thank you for making this available! I have exported the onnx models using the provided repo, but when I run the example code, I get:

Using CUDA...
←[0;93m2024-10-15 10:56:44.6301980 [W:onnxruntime:, graph.cc:108 onnxruntime::MergeShapeInfo] Error merging shape info for output. '/image_encoder/trunk/Concat_3_output_0' source:{4} target:{5}. Falling back to lenient merge.←[m
←[0;93m2024-10-15 10:56:45.1020236 [W:onnxruntime:, session_state.cc:1166 onnxruntime::VerifyEachNodeIsAssignedToAnEp] Some nodes were not assigned to the preferred execution providers which may or may not have an negative impact on performance. e.g. ORT explicitly assigns shape related ops to CPU to improve perf.←[m
←[0;93m2024-10-15 10:56:45.1179881 [W:onnxruntime:, session_state.cc:1168 onnxruntime::VerifyEachNodeIsAssignedToAnEp] Rerunning with verbose output on a non-minimal build will show node assignments.←[m
←[0;93m2024-10-15 10:56:45.1466023 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
←[0;93m2024-10-15 10:56:45.1531007 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
←[0;93m2024-10-15 10:56:45.1603321 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
←[0;93m2024-10-15 10:56:45.1664705 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
←[0;93m2024-10-15 10:56:45.1737079 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
←[0;93m2024-10-15 10:56:45.1795911 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
←[0;93m2024-10-15 10:56:45.1862360 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
←[0;93m2024-10-15 10:56:45.1929931 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
é"T误ï¼sFailed to load model. Please check your onnx file!
Aimol-l commented 1 day ago

Sorry, I'm not familiar with this issue either. I haven't encountered it before. Perhaps you can try exporting onnx again. https://github.com/Aimol-l/SAM2Export/tree/main

Hi, and thank you for making this available! I have exported the onnx models using the provided repo, but when I run the example code, I get:

Using CUDA...
←[0;93m2024-10-15 10:56:44.6301980 [W:onnxruntime:, graph.cc:108 onnxruntime::MergeShapeInfo] Error merging shape info for output. '/image_encoder/trunk/Concat_3_output_0' source:{4} target:{5}. Falling back to lenient merge.←[m
←[0;93m2024-10-15 10:56:45.1020236 [W:onnxruntime:, session_state.cc:1166 onnxruntime::VerifyEachNodeIsAssignedToAnEp] Some nodes were not assigned to the preferred execution providers which may or may not have an negative impact on performance. e.g. ORT explicitly assigns shape related ops to CPU to improve perf.←[m
←[0;93m2024-10-15 10:56:45.1179881 [W:onnxruntime:, session_state.cc:1168 onnxruntime::VerifyEachNodeIsAssignedToAnEp] Rerunning with verbose output on a non-minimal build will show node assignments.←[m
←[0;93m2024-10-15 10:56:45.1466023 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
←[0;93m2024-10-15 10:56:45.1531007 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
←[0;93m2024-10-15 10:56:45.1603321 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
←[0;93m2024-10-15 10:56:45.1664705 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
←[0;93m2024-10-15 10:56:45.1737079 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
←[0;93m2024-10-15 10:56:45.1795911 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
←[0;93m2024-10-15 10:56:45.1862360 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
←[0;93m2024-10-15 10:56:45.1929931 [W:onnxruntime:img_encoder, scatter_nd.h:51 onnxruntime::cuda::ScatterNDWithAtomicReduction::ScatterNDWithAtomicReduction] ScatterND with reduction=='none' only guarantees to be correct if indices are not duplicated.←[m
é"T误ï¼sFailed to load model. Please check your onnx file!