运行jar包报错:ai.djl.engine.EngineException: Failed to load PyTorch native library #2656
Black200000
started this conversation in
Development
Replies: 1 comment 1 reply
-
You need network access. DJL by default download PyTorch native library at runtime. You need package offline distribution jar file to support offline deployment. See: https://github.com/deepjavalibrary/djl-demo/tree/master/development/fatjar |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
命令:java -Dfile.encoding=UTF-8 -jar test.jar,服务器环境:麒麟操作系统,arm架构,不联网。
将ai.djl调用Pytorch模型的程序打成jar包运行,报错信息如下,求解答!程序未打包前可在 windows11的IDEA环境中正常调试运行
ai.djl.engine.EngineException: Failed to load PyTorch native library
at ai.djl.pytorch.engine.PtEngine.newInstance(PtEngine.java:77)
at ai.djl.pytorch.engine.PtEngineProvider.getEngine(PtEngineProvider.java:40)
at ai.djl.engine.Engine.getEngine(Engine.java:177)
at ai.djl.Model.newInstance(Model.java:98)
at ai.djl.repository.zoo.BaseModelLoader.createModel(BaseModelLoader.java:187)
at ai.djl.repository.zoo.BaseModelLoader.loadModel(BaseModelLoader.java:149)
at ai.djl.repository.zoo.Criteria.loadModel(Criteria.java:166)
Caused by: java.lang.IllegalStateException: Failed to download PyTorch native library
at ai.djl.pytorch.jni.LibUtils.downloadPyTorch(LibUtils.java:423)
at ai.djl.pytorch.jni.LibUtils.findNativeLibrary(LibUtils.java:266)
at ai.djl.pytorch.jni.LibUtils.getLibTorch(LibUtils.java:83)
at ai.djl.pytorch.jni.LibUtils.loadLibrary(LibUtils.java:71)
at ai.djl.pytorch.engine.PtEngine.newInstance(PtEngine.java:50)
... 17 more
Caused by: java.net.UnknownHostException: publish.djl.ai
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:196)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394)
at java.net.Socket.connect(Socket.java:606)
Beta Was this translation helpful? Give feedback.
All reactions