deepjavalibrary / djl

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

ai.djl.engine.EngineException: Failed to load PyTorch native library #2372

Open Cyu1 opened 1 year ago

Cyu1 commented 1 year ago

Caused by: java.lang.UnsatisfiedLinkError: C:\Users\80313223.djl.ai\pytorch\1.12.1-20220818-cpu-win-x86_64\asmjit.dll: Can't find dependent libraries ai.djl.engine.EngineException: Failed to load PyTorch native library

ai.djl.pytorch pytorch-jni 1.13.0-0.20.0 ai.djl.pytorch pytorch-native-cpu win-x86_64 runtime 1.13.0
frankfliu commented 1 year ago
  1. Are you using DJL API 0.20.0 jar, can you share your pom.xml or build.gradle file?
  2. Did you install VC++ redistribute package? See: https://docs.djl.ai/master/docs/development/troubleshooting.html#13-unsatisfiedlinkerror-issue
  3. Can you run DJL examples on your machine?
Cyu1 commented 1 year ago
  1. 你在使用 DJL API 0.20.0 jar,你能分享你的 pom.xml 或 build.gradle 文件吗?
  2. 您是否安装了 VC++ 重新分发包?请参阅:https ://docs.djl.ai/master/docs/development/troubleshooting.html#13-unsatisfiedlinkerror-issue
  3. 你能在你的机器上运行 DJL 示例吗?

1、并没有安装vc++ 2、没有测试过在自己机器上运行DJL演示,主要是写的自己得代码 3、pom文件引入了djl以及相关得spark,除此之外就没有其他引入了

ai.djl.pytorch pytorch-jni ${pytorch.native.version}-${djl.version} ai.djl.pytorch pytorch-native-cpu ${pytorch.native.classifier} runtime ai.djl.pytorch pytorch-jni ${pytorch.native.version}-${djl.version} ai.djl.pytorch pytorch-native-cpu ${pytorch.native.classifier} runtime ${pytorch.native.version}
Cyu1 commented 1 year ago
  1. 你在使用 DJL API 0.20.0 jar,你能分享你的 pom.xml 或 build.gradle 文件吗?
  2. 您是否安装了 VC++ 重新分发包?请参阅:https ://docs.djl.ai/master/docs/development/troubleshooting.html#13-unsatisfiedlinkerror-issue
  3. 你能在你的机器上运行 DJL 示例吗?

但是当我使用eclipse运行,项目可以正常执行。当使用idea运行代码,就会出现 failed to load pytorch native library.

ThiloteE commented 3 days ago

Please try one of two solutions that worked in my particular case:

Links and comments that helped me find the answers: