Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

linear convert error #8

Closed
oneTaken opened this issue Dec 5, 2017 · 2 comments
Closed

linear convert error #8

oneTaken opened this issue Dec 5, 2017 · 2 comments

Comments

@oneTaken
Copy link

oneTaken commented Dec 5, 2017

I convert the .onnx model to coreml model, And I found pooling pading mismatch bug , #7 .
And then , I found the linear layer convert error, There is missing w, just b for a linear layer, So I manully add w, and then the return MLModel(builder.spec) raises

RuntimeError: Error compiling model: "Error reading protobuf spec. validator error: Layer '250' consumes a layer named '136' which is not present in this network.".

I try to solve it by myself, and I found pytorch.onnx convert linear into Transpose and Gemm, I dived into the pytorch export file, and I got stucked in the trace part. So, I dived into onnx_coreml.convert file, and I got stucked in the 'from ..libcoremlpython import _MLModelProxy', thr libcoremlpython is .so file.

It's really a pain to use onnx_coreml, please spend some time to fix this, or tell me how to solve this.

@oneTaken
Copy link
Author

oneTaken commented Dec 5, 2017

And this is part of the graph, maybe helpful.

{
  %248 : Float(1, 1024, 1, 1) = AveragePool[kernel_shape=[7, 7], pads=[0, 0], strides=[7, 7]](%247)
  %249 : Float(1, 1024) = Reshape[shape=[1, -1]](%248)
  %250 : Float(1024!, 1024!) = Transpose[perm=[1, 0]](%136)
  %252 : Float(1, 1024) = Gemm[alpha=1, beta=1, broadcast=1](%249, %250, %137)
  %253 : Float(1, 1024) = Relu(%252)
  %254 : Float(1, 1024), %255 : UNKNOWN_TYPE = Dropout[is_test=1, ratio=0.5](%253)
  %256 : Float(1024!, 17!) = Transpose[perm=[1, 0]](%138)
  %258 : Float(1, 17) = Gemm[alpha=1, beta=1, broadcast=1](%254, %256, %139)
  return (%258);
}

@bhushan23
Copy link
Collaborator

@oneTaken could you please give a try with latest beta?
https://github.com/onnx/onnx-coreml#new-beta-onnx-coreml-converter-with-core-ml-3

feel free to re-open if you still face this issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants