Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mobile] #16792

Closed
taocheng opened this issue Jul 21, 2023 · 3 comments
Closed

[Mobile] #16792

taocheng opened this issue Jul 21, 2023 · 3 comments
Labels
platform:mobile issues related to ONNX Runtime mobile; typically submitted using template

Comments

@taocheng
Copy link

Describe the issue

when I use onnxruntime-objc,
env = try ORTEnv(loggingLevel: ORTLoggingLevel.warning)
let options = try ORTSessionOptions()
try options.setLogSeverityLevel(ORTLoggingLevel.warning)
try options.setIntraOpNumThreads(threadCount)
try options.appendExecutionProvider("xnnpack",providerOptions: ["intra_op_num_threads" : "2"])
let session = try ORTSession(env: env, modelPath: modelPath, sessionOptions: options)
the session get error,i have no idea ,why this happen, how can I use func appendExecutionProvider?

To reproduce

when I use onnxruntime-objc,
env = try ORTEnv(loggingLevel: ORTLoggingLevel.warning)
let options = try ORTSessionOptions()
try options.setLogSeverityLevel(ORTLoggingLevel.warning)
try options.setIntraOpNumThreads(threadCount)
try options.appendExecutionProvider("xnnpack",providerOptions: ["intra_op_num_threads" : "2"])
let session = try ORTSession(env: env, modelPath: modelPath, sessionOptions: options)
the session get error,i have no idea ,why this happen, how can I use func appendExecutionProvider?

Urgency

No response

Platform

iOS

OS Version

iOS 14.4

ONNX Runtime Installation

Other / Unknown

Compiler Version (if 'Built from Source')

No response

Package Name (if 'Released Package')

None

ONNX Runtime Version or Commit ID

onnxruntime-objc 1.5.0

ONNX Runtime API

Objective-C/Swift

Architecture

Other / Unknown

Execution Provider

Default CPU

Execution Provider Library Version

onnxruntime-objc 1.5.0

@taocheng taocheng added the platform:mobile issues related to ONNX Runtime mobile; typically submitted using template label Jul 21, 2023
@edgchen1
Copy link
Contributor

What's the error message?

@taocheng
Copy link
Author

sorry the parameters "xnnpack" should be"XNNPACK",that is my fault, another question I want switch cpu to gpu, it can be achieve?

@skottmckay
Copy link
Contributor

On iOS you could try the CoreML execution provider to use the Apple Neural Engine. We don't have an execution provider that uses Metal unfortunately. Will depend on the model as to how much of it CoreML can run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:mobile issues related to ONNX Runtime mobile; typically submitted using template
Projects
None yet
Development

No branches or pull requests

3 participants