-
Notifications
You must be signed in to change notification settings - Fork 661
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
Error occured after packaging to jar #1428
Comments
You might hit this issue: #940 Can you share your dependencies and build script file? And aslo share the file names in your .jar file:
|
@frankfliu Here is my pom.xml: pom.xml
I ran 'java -jar PersonDetect-1.0-SNAPSHOT-jar-with-dependencies.jar' and here is what I got: Error
|
@UESTCkevin We use ServiceLoader to load model zoo and engines. Or you can consider use gradle to build project. In gradle it's pretty straight-forward, see example: https://github.com/deepjavalibrary/djl/blob/master/engines/mxnet/jnarator/build.gradle#L28 |
@frankfliu Thanks for replying. I switched maven-assembly-plugin to maven-shade-plugin. This is my new pom.xml:
After I executed mvn clean package I got two .jar files in the 'target' folder which are 'PersonDetect-1.0-SNAPSHOT.jar' and 'original-PersonDetect-1.0-SNAPSHOT.jar'. I executed java -jar PersonDetect-1.0-SNAPSHOT.jar but I still got the same error as below:
Do you have any other advice? |
@UESTCkevin You might want to enable debug log level, so you can see the detail about model loading: https://docs.djl.ai/master/docs/development/configure_logging.html#configure-logging-level |
@frankfliu Thanks for replying. This is my project address:https://github.com/UESTCkevin/PersonDetect |
I tried your project on Windows, it's working fine in both IntelliJ and command line:
The error most likely is because you are running in |
@frankfliu |
I was trying to load a Onnx model by using ModelZoo.loadModel(). Here is my code:
123
The text was updated successfully, but these errors were encountered: