axon_onnx icon indicating copy to clipboard operation
axon_onnx copied to clipboard

Error importing microsoft/swin-base-patch4-window12-384

Open bosko opened this issue 1 year ago • 0 comments

I am trying to import microsoft/swin-base-patch4-window12-384 with:

AxonOnnx.import("../../models/swin-base-patch4-window12-384-export/model.onnx",
    batch_size: 32,
    num_channels: 3,
    height: 384,
    width: 384)

but I get an error:

Bug Bug ..!!** (ArgumentError) length at axis 0 must be greater than or equal to 1, got: 0
    (nx 0.5.3) lib/nx/shape.ex:1204: Nx.Shape.do_slice/7
    (nx 0.5.3) lib/nx.ex:10120: Nx.slice/4
    (elixir 1.16.0) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3
    (axon_onnx 0.4.0) lib/axon_onnx/shared.ex:157: AxonOnnx.Shared.slice_layer/8
    (axon_onnx 0.4.0) lib/axon_onnx/deserialize.ex:1379: AxonOnnx.Deserialize.recur_nodes/2
    (elixir 1.16.0) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3
    (axon_onnx 0.4.0) lib/axon_onnx/deserialize.ex:43: AxonOnnx.Deserialize.graph_to_axon/2
    iex:1: (file)

Model was exported from Huggingface with

optimum-cli export onnx --model microsoft/swin-base-patch4-window12-384 swin-base-patch4-window12-384-export/

bosko avatar May 06 '24 06:05 bosko