Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Web] Unsupported model IR version: 9, max supported IR version: 8 #16638

Open
xenova opened this issue Jul 9, 2023 · 9 comments
Open

[Web] Unsupported model IR version: 9, max supported IR version: 8 #16638

xenova opened this issue Jul 9, 2023 · 9 comments
Labels
platform:web issues related to ONNX Runtime web; typically submitted using template

Comments

@xenova
Copy link

xenova commented Jul 9, 2023

Describe the issue

Unlike the onnxruntime python library, the web version does not yet support model IR version 9. I believe this is due to the onnx-proto dependency being quite out-of-date (last update published over a year ago).

Looking at their distributed "onnx.js" file (https://www.npmjs.com/package/onnx-proto?activeTab=code), IR_VERSION=8 is the latest entry into the version object. On the other hand, netron supports IR_VERSION=9, and this is the onnx-proto.js file that they use: https://github.com/lutzroeder/netron/blob/main/source/onnx-proto.js

Logs:
image

To reproduce

Load a model exported with onnx>=1.14.0

Urgency

I am able to work around it by exporting models with onnx==1.13.1, however, the web version should ideally match the python version (which is able to run IR_VERSION=9).

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.15.1

Execution Provider

'wasm'/'cpu' (WebAssembly CPU)

@xenova xenova added the platform:web issues related to ONNX Runtime web; typically submitted using template label Jul 9, 2023
@xenova
Copy link
Author

xenova commented Jul 9, 2023

cc @fs-eire, @guschmue

@fs-eire
Copy link
Contributor

fs-eire commented Jul 9, 2023

will make a change to upgrade IR version support

@fs-eire
Copy link
Contributor

fs-eire commented Jul 10, 2023

Submitted a PR for the upstream package 'onnx-proto': chaosmail/onnx-proto#7

Once it's get merged and released a new version, I can upgrade onnxruntime-web to consume it

fs-eire added a commit that referenced this issue Jul 18, 2023
### Description
This change upgrades a lot of dependencies. There are 2 motivations of
doing this change:
- fix the security issue reported by dependabot (protobufjs Prototype
Pollution vulnerability -
GHSA-h755-8qp9-cq85)
 - resolve the requirement of using ONNX IR_VERSION 9 (#16638)


This requires:
- upgrade protobufjs to v7.2.4
- upgrade library 'onnx-proto' to consume latest ONNX release (v1.14.0).

Problems:
- protobufjs v7.2.4 depends on long.js v5, which does not work well with
typescript (commonjs).
- onnx-proto depends on this fix with a new release of long.js
- long.js is in maintenance and it takes longer than expected to put in
new changes

Solutions:
- use a patch script in `preprepare` to copy type declarations to make
long.js work with typescript (commonjs)
- generate onnx protobuf JS/TS files and put them under
js/web/lib/onnxjs/ort-schema/protobuf folder - remove 'onnx-proto' from
dependency.
- apply fixes to generated onnx.d.ts
@Luckre
Copy link

Luckre commented Jan 1, 2024

Any updates?

@fs-eire
Copy link
Contributor

fs-eire commented Jan 2, 2024

Any updates?

I think this issue should have been fixed in #16722.

@lix19937
Copy link

lix19937 commented May 4, 2024

similar Unsupported model IR version: 10, max supported IR version: 9

@fs-eire
Copy link
Contributor

fs-eire commented May 5, 2024

similar Unsupported model IR version: 10, max supported IR version: 9

Which execution provider and which version are you using?

@lix19937
Copy link

lix19937 commented May 6, 2024

@fs-eire provider is cpu
onnx 1.16
onnxruntime 1.17.1

after downscale the version of onnx to 1.15, the error is missed.

@fs-eire
Copy link
Contributor

fs-eire commented May 6, 2024

I see. Onnxruntime 1.17.1 is relatively outdated and latest dev channel should support IR v10

siweic0 pushed a commit to siweic0/onnxruntime-web that referenced this issue May 9, 2024
### Description
This change upgrades a lot of dependencies. There are 2 motivations of
doing this change:
- fix the security issue reported by dependabot (protobufjs Prototype
Pollution vulnerability -
GHSA-h755-8qp9-cq85)
 - resolve the requirement of using ONNX IR_VERSION 9 (microsoft#16638)


This requires:
- upgrade protobufjs to v7.2.4
- upgrade library 'onnx-proto' to consume latest ONNX release (v1.14.0).

Problems:
- protobufjs v7.2.4 depends on long.js v5, which does not work well with
typescript (commonjs).
- onnx-proto depends on this fix with a new release of long.js
- long.js is in maintenance and it takes longer than expected to put in
new changes

Solutions:
- use a patch script in `preprepare` to copy type declarations to make
long.js work with typescript (commonjs)
- generate onnx protobuf JS/TS files and put them under
js/web/lib/onnxjs/ort-schema/protobuf folder - remove 'onnx-proto' from
dependency.
- apply fixes to generated onnx.d.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:web issues related to ONNX Runtime web; typically submitted using template
Projects
None yet
Development

No branches or pull requests

4 participants