DNNLibrary icon indicating copy to clipboard operation
DNNLibrary copied to clipboard

ONNX operators needed to be supported

Open daquexian opened this issue 5 years ago • 11 comments

This issue is to summarize all operators which needed to be supported. If you want an operator to be supported, please feel free to post it here.

  • [x] LRN(#16, supported in #46)
  • [x] PRelu(#13, implemented in #23)
  • [x] Identify(#13, supported in #24)
  • [x] BatchNorm(most batchnorm will be fused into conv so there is no need to support batchnorm in these cases, but a few models(like resnet v2) has a bn->relu->conv sequence, which makes bn unable to be fused into conv.) (Supported in #38 )
  • [ ] Resize

daquexian avatar Dec 11 '18 08:12 daquexian

Constant operator

AmienKhaled avatar Dec 22 '18 20:12 AmienKhaled

PReLU has been supported in #23

@AmienKhaled I'll implement it soon

daquexian avatar Jan 10 '19 09:01 daquexian

@AmienKhaled @yunhaia

In version 0.6.0, identity, prelu and constant op should be supported (please also use the latest onnx2daq)

daquexian avatar Jan 11 '19 02:01 daquexian

Reshape can only be the last layer

ericdanz avatar Jan 19 '19 03:01 ericdanz

@ericdanz reshape layer is somewhat special due to the difference between nhwc(nnapi) and nchw(onnx) layout. I think there is no general, simple way to implement reshape layer, and most reshape layers in an onnx model are indeed generated implicitly. Could you please provide your model so that I can analyze it?

daquexian avatar Jan 19 '19 12:01 daquexian

I can share the onnx file. Quick warning - it's a bit complicated ;) https://drive.google.com/file/d/1WdWn12HPr5Ziz69PBk-JyU8YtiEfU2mu/view?usp=sharing

There are a few places reshape is used, in my special batchnorm and shuffle-net like layers.

ericdanz avatar Jan 21 '19 03:01 ericdanz

@ericdanz Thanks for your model. Unfortunately, the reshape here is hard to implement in nnapi. I'll open another issue to track it. However, it may be a long-term work.

daquexian avatar Jan 22 '19 11:01 daquexian

Concat is causing some problems - had to disable the shape checking in shaper.cpp

Upsample is also not supported yet.

Made a model that is compatible, about to test it out! Very excited to see more and more ops supported ;)

ericdanz avatar Jan 28 '19 20:01 ericdanz

Thanks for your valuable information!

I will look into it today (It is 7:06 AM, GMT+8 here XD)

Thanks again!

On Tue, Jan 29, 2019, 4:08 AM ericdanz <[email protected] wrote:

Concat is causing some problems - had to disable the shape checking in shaper.cpp

Upsample is also not supported yet.

Made a model that is compatible, about to test it out! Very excited to see more and more ops supported ;)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/daquexian/DNNLibrary/issues/17#issuecomment-458282131, or mute the thread https://github.com/notifications/unsubscribe-auth/ALEcn6OwqZ0UXXKevlqqWEUYgcwGG6lvks5vH1i3gaJpZM4ZM5hH .

daquexian avatar Jan 28 '19 23:01 daquexian

Transpose would be useful when converting caffe models.

mbishop-neurala avatar Aug 13 '19 20:08 mbishop-neurala

@ericdanz @daquexian Do you happen to have such large pytorch model that could be further optimized after ONNX export?

neginraoof avatar Jun 04 '20 21:06 neginraoof