deepjavalibrary / djl

An Engine-Agnostic Deep Learning Framework in Java
https://djl.ai
Apache License 2.0
4.07k stars 650 forks source link

Support for ONNX models #94

Closed la-cruche closed 4 years ago

la-cruche commented 4 years ago

Description

It would be nice for DJL to be able to run inference on ONNX-formatted model.

Will this change the current api? How?

Who will benefit from this feature?

ONNX is popular for DL developers as an intermediary artifact representation between DL training frameworks and DL inference engines. ONNX users looking for a java inference front-end will benefit from this. For example this could open-up easy portability of ONNX to Android

References

keerthanvasist commented 4 years ago

Thank you for your suggestion @la-cruche. We are actively considering adding ONNX runtime support in DJL.

zachgk commented 4 years ago

Another option you can do now is to try importing your onnx model into another framework such as mxnet (https://mxnet.apache.org/api/python/docs/api/contrib/onnx/index.html?highlight=onnx) or keras/tensorflow (https://github.com/nerox8664/onnx2keras) and then converting your model into their model format

lanking520 commented 4 years ago

Currently we have an experimental support with ONNX Rutime: https://github.com/awslabs/djl/tree/master/onnxruntime/onnxruntime-engine Please let us know if you are facing any difficulties trying out. There will be more tutorials coming out soon.