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

model preparing ? #231

Open
vlordier opened this issue Sep 8, 2019 · 1 comment
Open

model preparing ? #231

vlordier opened this issue Sep 8, 2019 · 1 comment

Comments

@vlordier
Copy link

vlordier commented Sep 8, 2019

I am getting a
'Unexpected output type from the model: {}'.format(type(outputs)))
and I wonder if I need to do something to prepare my Chainer model (output layer naming or something) prior to export ?

not sure how to debug that.

@disktnk
Copy link
Member

disktnk commented Sep 9, 2019

The error is from https://github.com/chainer/onnx-chainer/blob/v1.5.1a1/onnx_chainer/export.py#L399

If the target model returns a value which is not chainer.Variable type, the RuntimeError would be, example:

class Model(chainer.Chain):

    def __init__(self):
        super().__init__()
        with self.init_scope():
            self.l1 = L.Linear(4)
            self.l2 = L.Linear(5, initial_bias=0.1)

    def forward(self, x):
        y = self.l1(x)
        z = self.l2(y)
        return z.array  # return numpy ndarray, not return chainer.Variable, then cannot export

If you couldn't clear the issue, could you provide reproducible source?

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

No branches or pull requests

2 participants