-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Open
Labels
platform:webissues related to ONNX Runtime web; typically submitted using templateissues related to ONNX Runtime web; typically submitted using template
Description
Incorrect output name mapping when using run() with a single output in fetches
Description
When calling InferenceSession.run() with a single output specified in fetches, the returned output map contains incorrect keys.
Instead of returning the requested output name, the data is returned under a different output name, and the requested key is missing.
Expected behavior
session.run(feeds, ['sentence_embedding'])
The result should contain:
- key:
sentence_embedding - value: pooled embedding tensor with shape
[B, 768]
Actual behavior
const res = await session.run(feeds, ['sentence_embedding']);
Returned result:
- keys:
['last_hidden_state'] - last_hidden_state.dims →
[B, 768] - sentence_embedding →
undefined
The data for sentence_embedding is incorrectly returned under last_hidden_state.
Control case (works correctly)
const res = await session.run(feeds);
Returned result:
- last_hidden_state.dims →
[B, L, 768] - sentence_embedding.dims →
[B, 768]
Notes
- Reproducible across multiple Node.js versions
- Reproducible across multiple
onnxruntime-nodeversions - Occurs when
fetchesis provided both as an array and as an object map
Metadata
Metadata
Assignees
Labels
platform:webissues related to ONNX Runtime web; typically submitted using templateissues related to ONNX Runtime web; typically submitted using template