onnxscript: Illegal "IsScalar" node encountered in exported ONNX model

An exported model contains an IsScalar op which is not in the ONNX spec. image

Seems like it comes from the use of common_ops.IsScalar in aten_mean_dim.

Env: torch 2.3.0.dev20240202+cu121 onnxscript 0.1.0.dev20240203 MONAI installed with pip3 install git+https://github.com/Project-MONAI/MONAI@0.8.1#egg=MONAI

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 26 (18 by maintainers)

Commits related to this issue

Most upvoted comments

Hmmm. There was an issue in the exporter/onnxscript relating to gathering all necessary imports (re. the reverted fix, as Bowen mentions above). That does still need to be fixed, right?

Both model opset_import and functions opset_imports are actually correct without the fix. So it is not needed.

I have checked that the inliner in onnx-weekly works correctly on OP’s model, where as inliner in onnx 1.15 would leave out an IsScalar node inside an if subgraph, while removing IsScalar from model.functions.

image

image

@yuanyao-nv the OP issues turns out to be bug in (previous) Netron display and onnx 1.15 inliner. Both should be fixed in latest version.