onnx-coreml icon indicating copy to clipboard operation
onnx-coreml copied to clipboard

Tensor initializers aren't getting converted to constants

Open s1ddok opened this issue 4 years ago • 3 comments

Even though onnx contain needed input as tensor initializer:

image

The model yields an error while converting:

Underlying exception message was: Error compiling model: "Error reading protobuf spec. validator error: Layer 'Pad_0' consumes an input named 'initial_block' which is not present in this network.".
  RuntimeWarning)

is there a way to support constant inputs to layers?

s1ddok avatar Jun 23 '20 21:06 s1ddok

@s1ddok you can call load_input_constants before converting node! see here Which node is this? we might not be calling load_input_constants for this operator

bhushan23 avatar Jul 06 '20 03:07 bhushan23

also, you can give a try to new pytorch converter https://coremltools.readme.io/docs/pytorch-conversion

bhushan23 avatar Jul 06 '20 03:07 bhushan23

@bhushan23 it happens with constant input to padding and then conv. I manually patched converter to load that constant

s1ddok avatar Jul 06 '20 08:07 s1ddok