Skip to content

Switching backends yields error - Failed to execute 'dispatch' on 'MLContext': Invalid inputs: The context of MLGraph doesn't match the context of the MLTensor with name "pixel_values" #69

Description

@ibelem

Repro Steps:

  1. Run WebNN on a NPU supported device e.g. Intel LNL
  2. Enable WebNN on Chrome Canary
  3. Visit Image Classification demo on NPU https://microsoft.github.io/webnn-developer-preview/demos/image-classification/?provider=webnn&devicetype=npu&model=mobilenet-v2&run=1
  4. Click Classify button

Actual Result

PASS

Repro Steps: (cont.)

  1. Click WebNN GPU button
  2. Click Classify button

Actual Result

Failed to execute 'dispatch' on 'MLContext': Invalid inputs: The context of MLGraph doesn't match the context of the MLTensor with name "pixel_values"

Note

Error also occurs when switching from WebNN GPU to WebNN NPU

Environment

  • Google Chrome Version 133.0.6887.4 (Official Build) canary (64-bit)

This version of Transformers.js distribution was built using the following components:

  1. ONNX Runtime Web: 1.21.0-dev.20241122-a2ba3cb547
  2. Transformers.js: v3 branch
  3. Get performance data: patch

Related Issues

Related Fixes

@egalli Please help to check this issue. Thanks!

CC @fdwr @Honry

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions