Skip to content

[Image Classification] Failed to execute 'dispatch' on 'MLContext': Invalid inputs #46

Description

@ibelem

Failed to execute 'dispatch' on 'MLContext' after landing #45

Repro Steps A

  1. Enable WebNN in browser
  2. Visit https://microsoft.github.io/webnn-developer-preview/demos/image-classification/?provider=webnn&devicetype=gpu&model=mobilenet-v2&run=1
  3. Click "Classify" button
  4. It will show performance results, click "Classify" button again

Repro Steps B

  1. Enable WebNN in browser
  2. Visit https://microsoft.github.io/webnn-developer-preview/demos/image-classification/?provider=webnn&devicetype=gpu&model=mobilenet-v2&run=1
  3. Click "Classify" button
  4. It will show performance results, click "ResNet50" button
  5. 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".

Image

@egalli do you have any clue to fix this issue, thanks!

CC @Honry @fdwr @huningxin

Note

This issue didn't occur by using compute() in ORT Web before.

How to build the Transformers.js dists and apply for developer preview image classification demo

  1. Clone https://github.com/xenova/transformers.js/tree/v3 // "onnxruntime-web": "1.20.0-dev.20241016-2b8fc5529b",
  2. npm install
  3. Apply the patch https://github.com/ibelem/transformers.js/blob/v3-webnn-2/0001-v3-perf-code.patch or follow the code change in ibelem/transformers.js@7cb760f
  4. npm run build
  5. Copy the dists from /transformers.js/dist to webnn-developer-preview/assets/dist_transformers/dynamic-runs-1.19-dev/

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