-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
api:Javaissues related to the Java APIissues related to the Java APIplatform:mobileissues related to ONNX Runtime mobile; typically submitted using templateissues related to ONNX Runtime mobile; typically submitted using templatestaleissues that have not been addressed in a while; categorized by a botissues that have not been addressed in a while; categorized by a bot
Description
Describe the issue
How to use GPU acceleration on Android?The detector model is now too slow to predict!
To reproduce
this.context = context;
env = OrtEnvironment.getEnvironment();
// 预分配内存
inputArray = new float[INPUT_SIZE * INPUT_SIZE * 3];
pixels = new int[INPUT_SIZE * INPUT_SIZE];
inputBuffer = FloatBuffer.wrap(inputArray);
session = env.createSession(modelPath, sessionOptions);
inputTensor = OnnxTensor.createTensor(env, inputBuffer, new long[]{1, 3, INPUT_SIZE, INPUT_SIZE});
result = session.run(Collections.singletonMap(session.getInputNames().iterator().next(), inputTensor));
Urgency
No response
Platform
Android
OS Version
14
ONNX Runtime Installation
Built from Source
Compiler Version (if 'Built from Source')
No response
Package Name (if 'Released Package')
None
ONNX Runtime Version or Commit ID
1.20.0
ONNX Runtime API
Java/Kotlin
Architecture
X64
Execution Provider
Other / Unknown
Execution Provider Library Version
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api:Javaissues related to the Java APIissues related to the Java APIplatform:mobileissues related to ONNX Runtime mobile; typically submitted using templateissues related to ONNX Runtime mobile; typically submitted using templatestaleissues that have not been addressed in a while; categorized by a botissues that have not been addressed in a while; categorized by a bot