Skip to content

Segment Anything example fails with "invalid rank for input" on Mac with Chrome #364

@mprynce

Description

@mprynce
  • Mac M1 Pro running Sonoma 14.2.1
  • Chrome 120.0.6099.129
  • Example webpage fails in Javascript with
    Uncaught (in promise) Error: failed to call OrtRun(). ERROR_CODE: 2, ERROR_MESSAGE: Invalid rank for
    input: input_image Got: 4 Expected: 3 Please fix either the inputs/outputs or the model.

The same webpage/example works fine with Safari

I tried fixing the main.js to reduce the rank to 3 (removing batch dimension), but a second error popped up indicating the tensor should be HWC, but instead the Tensor was CHW.

Metadata

Metadata

Assignees

No one assigned

    Labels

    javascriptPull requests that update Javascript code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions