1

I am trying to use AI DJL pytorch package inside ONOS karaf application. I tried including the dependencies as bundles for the karaf build. I am able to run ai djl pytorch model outside karaf application without any errors, but there is some issues with adding the package as a bundle.

enter image description here

It says no deep learning engine found

I tried to include all the dependencies of the package also as a bundle

    "ai-djl-api" : "mvn:ai.djl:api:0.19.0",
    "ai-djl-pytorch":"mvn:ai.djl.pytorch:pytorch-engine:0.19.0",
    "ai-djl-pytorch-native-cpu" : "mvn:ai.djl.pytorch:pytorch-native-cpu:1.13.0",
    "net_java_dev_jna" : "mvn:net.java.dev.jna:jna:5.12.1",
    "org_apache_compress" : "mvn:org.apache.commons:commons-compress:1.21"

still i am unable to load pytorch engine

1 Answers1

1

DJL use service loader, the META-INF/services/ai.djl.engine.EngineProvider file might get lost when you re-package your jar file. See: https://github.com/deepjavalibrary/djl/issues/940

You might also want to take a look this example: https://github.com/deepjavalibrary/djl-demo/tree/master/development/fatjar

Frank Liu
  • 281
  • 1
  • 4