Comments (5)
If you want the model to gracefully handle zero matches it would have to have an If node to do conditional processing of the bounding boxes. Probably simpler to just ignore the error.
You have to keep ortEnv alive for longer than the session.
from onnxruntime.
If there are zero elements it sounds like there were either no matches in your input image, or the NonMaxSuppression parameters were too strict and resulted in no matches being selected.
CoreML doesn't handle this sort of empty data scenario, but given there are no matches, you could gracefully handle this specific error as an expected result. the output if CoreML did handle empty tensors would still be an empty result set.
from onnxruntime.
Hi Scott, Thank you. There are no matches in the input image as it doesn't contain any people but the model Does this mean I have to fix the ONNX conversion code to not produce the empty intermediate tensor ? For now I am just gonna ignore this error and continue with processing as I have no idea how to fix the ONNX code. Please close this ticket if that's appropriate.
from onnxruntime.
Hi @skottmckay This problem is resolved. However the application crashes when I move the app to background or click the back button from the viewController. I see this error message, just before the app crashes. Do you have some idea on what's causing this error ? I have used the Apple profiling tools to debug the crash but so far no luck. If I get rid of the onnx code, the app doesn't crash. Thank you and appreciate all your help.
Particularly in the below - sourceURL= (null) is what I thought is relevant. But how can this be as the model is loaded and present in the URL.
Here is the Onnx model initialization code in the viewDidLoad method of the UIViewController for reference.
func getOrtSessionFromModelName() {
guard let modelPath = Bundle.main.path(forResource: "yolov8n-pose-pre", ofType: "onnx") else {
fatalError("Model file not found")
}
do {
let ortEnv = try ORTEnv(loggingLevel: ORTLoggingLevel.verbose)
let ortSessionOptions = try ORTSessionOptions()
let ortCoreMlSessionOptions = ORTCoreMLExecutionProviderOptions()
try ortSessionOptions.appendCoreMLExecutionProvider(with: ortCoreMlSessionOptions)
try ortSessionOptions.registerCustomOps(functionPointer: RegisterCustomOps) // Register the bridging-header in Build settings
self.ortSession = try ORTSession(
env: ortEnv, modelPath: modelPath, sessionOptions: ortSessionOptions)
} catch {
NSLog("Model initialization error \(error)")
}
}
Onnx error
doUnloadModel:options:qos:error:: model=_ANEModel: { modelURL=file:///var/mobile/Containers/Data/Application/301E1763-54D6-4431-9B1A-3294A056FBA7/tmp/6A93CDD5-8D34-44F2-A691-95411FDEB8CE-37346-000007A9FCF753F7.mlmodelc/ : sourceURL= (null) : key={"isegment":0,"inputs":{"_ppp10_ratios":{"shape":[1,1,1,1,1]},"_ppp10_restored_boxes":{"shape":[4,1,1,1,1]}},"outputs":{"_ppp10_scaled_boxes":{"shape":[4,1,1,1,1]}}} : identifierSource=0 : cacheURLIdentifier=7A231F7B75EAC6E19B6CEDE90D4C3D277988F5D3E8FA9C863F3BCC3B2D5BA85E_EF23976A43D6FF8A9AEBDC07236D5C309D2A0CBA853E0840F49DA977C90899F2 : string_id=0x00000000 : program=_ANEProgramForEvaluation: { programHandle=8426675537938 : intermediateBufferHandle=0 : queueDepth=127 } : state=3 : programHandle=8426675537938 : intermediateBufferHandle=0 : queueDepth=127 : attr={
ANEFModelDescription = {
ANEFModelInput16KAlignmentArray = (
);
ANEFModelOutput16KAlignmentArray = (
);
ANEFModelProcedures = (
{
ANEFModelInputSymbolIndexArray = (
0,
1
);
ANEFModelOutputSymbolIndexArray = (
0
);
ANEFModelProcedureID = 0;
}
);
kANEFModelInputSymbolsArrayKey = (
52f4d8d25e7baac36ed8c8986c297c11,
9768afc0313486df07fc876a87706597
);
kANEFModelOutputSymbolsArrayKey = (
"5ccf048a34df2cee4c57251c6e60c479@output"
);
kANEFModelProcedureNameToIDMapKey = {
net = 0;
};
};
NetworkStatusList = (
{
LiveInputList = (
{
BatchStride = 64;
Batches = 1;
Channels = 1;
Depth = 1;
DepthStride = 64;
Height = 1;
Interleave = 1;
Name = 52f4d8d25e7baac36ed8c8986c297c11;
PlaneCount = 1;
PlaneStride = 64;
RowStride = 64;
Symbol = 52f4d8d25e7baac36ed8c8986c297c11;
Type = Float16;
Width = 4;
},
{
BatchStride = 64;
Batches = 1;
Channels = 1;
Depth = 1;
DepthStride = 64;
Height = 1;
Interleave = 1;
Name = 9768afc0313486df07fc876a87706597;
PlaneCount = 1;
PlaneStride = 64;
RowStride = 64;
Symbol = 9768afc0313486df07fc876a87706597;
Type = Float16;
Width = 1;
}
);
LiveOutputList = (
{
BatchStride = 64;
Batches = 1;
Channels = 1;
Depth = 1;
DepthStride = 64;
Height = 1;
Interleave = 1;
Name = "5ccf048a34df2cee4c57251c6e60c479@output";
PlaneCount = 1;
PlaneStride = 64;
RowStride = 64;
Symbol = "5ccf048a34df2cee4c57251c6e60c479@output";
Type = Float16;
Width = 4;
}
);
Name = net;
}
);
} : perfStatsMask=0} was not loaded by the client.`
from onnxruntime.
Closing this issue. Thank @skottmckay
from onnxruntime.
Related Issues (20)
- ONNX Runtime doesn't support the graph optimization of vision-encoder-decoder yet HOT 1
- cannot resolve operator 'HardSwish' with opsets: ai.onnx v9 [Web] HOT 1
- cuda's FusedConv is not support Sigmod HOT 2
- [Mobile] Subgraphs duplicate initializers in RAM during execution HOT 9
- [Web] The YOLOv8 segmentation model with batching option is not runing on the GPU ? HOT 3
- [Performance] Regression observed when using CUDA execution provider HOT 16
- Onnxruntime-directml 1.18.0 broken multithreading inference session HOT 13
- [Build] 0.18.0 release breaks Hummingbird build pipeline HOT 5
- Windows ARM64 & X64 CLIP Image Encoder different results HOT 2
- .. HOT 1
- [Feature Request] Get device ids via get_available_device_ids()
- [Training] IR version incompatibility in artifact generation for on-device training HOT 5
- npm install provides error on onnxruntime: 404 URL not found. HOT 2
- [Build] GCC Linker can't find re2 HOT 3
- [Web] `executionProviders` chain for `webnn` fallback does not work on init error HOT 29
- pip install failure for onnxruntime-gpu==1.9.0 HOT 6
- Get error while using Dml EP HOT 6
- ONNX I/O Binding HOT 5
- [Build] Support CUDA 12 onnxruntime-gpu pypi package HOT 10
- [Build] --external_graph_transformer_path doesn't. --test_external_transformer_example removed from build.py? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onnxruntime.