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

Bug when trying to load multiple engines in DJL #57

Closed
roywei opened this issue Apr 25, 2020 · 2 comments
Closed

Bug when trying to load multiple engines in DJL #57

roywei opened this issue Apr 25, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@roywei
Copy link
Contributor

roywei commented Apr 25, 2020

There are a few bugs in DJL right now when you try to use multiple engines.

For example if we use MXNet and TensorFlow engine together. If I set -Dai.djl.default_engine=MXNet, and call a TfEngine or TfModelZoo method, MxEngine and MxModelZoo is actually returned.

  1. TfEngine.getInstance() will return Default Engine instead of TfEngine.

  2. TfModelZoo.RESNET.loadModel() will return MxModel.RESNET if default engine is MXNet, will return PyModel.RESNET if default engine is Pytorch. But user already specified to use TfModelZoo

  3. In Criteria.builder() the .optEngine("TensorFlow") option is not used by ModelZoo during loading model.

Right now the 2 ways to work with multiple engines are:

  1. manually switch engine by setting system property ai.djl.default_engine back and forth
  2. use newInstance with engineName will return the correct implementation under that engine:
    Model tfModel = Model.newInstance(Device.defaultDevice(), "TensorFlow")
@roywei roywei added the bug Something isn't working label Apr 25, 2020
@roywei
Copy link
Contributor Author

roywei commented Apr 27, 2020

@JonTanS

@JonTanS
Copy link
Contributor

JonTanS commented May 28, 2020

Fixed and merged, reference commit id: a8c4bfc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants