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

Menoh error loading model from onnx file #221

Open
kmorito opened this issue Mar 1, 2019 · 5 comments
Open

Menoh error loading model from onnx file #221

kmorito opened this issue Mar 1, 2019 · 5 comments

Comments

@kmorito
Copy link

kmorito commented Mar 1, 2019

Hi
I'm trying to run Menoh with the ONNX file converted from the Keras/Tensorflow model.
The following error occurs when calling the menoh function "make_model_data_from_onnx".
menoh invalid attribute type error: attribute type TENSOR for "value"

This ONNX file was created using mmdnn.
$ mmdownload -f keras -n vgg16 -o ./
$ mmconvert -sf keras -iw imagenet_vgg16.h5 -df onnx -om imagenet_vgg16.onnx

OS: Windows 10
Keras 2.2.2
Tensorflow 1.8.0
onnx-tf 1.2.1
Menoh 1.2.0

For the following file It works.
wget('https://preferredjp.box.com/shared/static/o2xip23e3f0knwc5ve78oderuglkf2wt.onnx', './data/vgg16.onnx')

What should I check?

Kind

@okdshin
Copy link
Contributor

okdshin commented Mar 1, 2019

Hi @kmorito
It seems Constant operator is contained in imagenet_vgg16.onnx.
Menoh 1.2.0 doesn't support Constant operator.
Now PR for Constant is created #222 . It will be merged soon.
Also you can use this feature of ONNX official to delete Constant node.

@kmorito
Copy link
Author

kmorito commented Mar 5, 2019

Hi @okdshin
Thank you for your reply.

I tried #222 , but the following error occured.
menoh unsupported operator error: Flatten

Menoh doesn't support Flatten node ?
Is it as intended?

Kind

@okdshin
Copy link
Contributor

okdshin commented Mar 11, 2019

Sorry for my late reply.
Flatten node is not supported yet. I estimate Flatten is used to connect the last fc layer in keras's VGG16. Chainer's VGG16 uses Reshape instead of Flatten and Menoh merely ignores the Reshape node. I think you can delete flatten node from the model.
Sorry for inconvinience. I will add Flatten node.

@kmorito
Copy link
Author

kmorito commented Mar 12, 2019

Hi @okdshin

It's working!
This is well parallelized internally. That's good.
Thank you for your help.
I hope to be supported some other effective node. For example PReLU or so... :)

Kind

@okdshin
Copy link
Contributor

okdshin commented Aug 29, 2019

Hi @kmorito . Just FYI, now chainer-compiler's menoh API is available. It is compatible to menoh and it supports more ops (including PRelu) and more backends (Intel GPU, CUDA).
https://github.com/pfnet-research/chainer-compiler/tree/master/menoh

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