deepjavalibrary / deepjavalibrary/djl

Failed to download libraries

Open
#2,247 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
4.9k
Forks
759
Avg merge
19h 26m
Merged PRs (30d)
17

Description

## Description
Some files are failing to download after updating pytorch-engine to 0.20.0, the files aren't on your cloud instances so DJL just throws an error

### Expected Behavior
Downloads properly

### Error Message
```
ai.djl.engine.EngineException: Cannot download jni files: https://publish.djl.ai/pytorch/1.9.1/jnilib/0.20.0/linux-x86_64/cu111/libdjl_torch.so
at ai.djl.pytorch.jni.LibUtils.downloadJniLib(LibUtils.java:515)
at ai.djl.pytorch.jni.LibUtils.findJniLibrary(LibUtils.java:252)
at ai.djl.pytorch.jni.LibUtils.loadLibrary(LibUtils.java:80)
at ai.djl.pytorch.engine.PtEngine.newInstance(PtEngine.java:54)
at ai.djl.pytorch.engine.PtEngineProvider.getEngine(PtEngineProvider.java:40)
at ai.djl.engine.Engine.getEngine(Engine.java:186)
at ai.djl.engine.Engine.getInstance(Engine.java:141)
Caused by: java.io.FileNotFoundException: https://publish.djl.ai/pytorch/1.9.1/jnilib/0.20.0/linux-x86_64/cu111/libdjl_torch.so
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
at java.base/java.net.URL.openStream(URL.java:1161)
at ai.djl.util.Utils.openUrl(Utils.java:459)
at ai.djl.util.Utils.openUrl(Utils.java:443)
at ai.djl.pytorch.jni.LibUtils.downloadJniLib(LibUtils.java:509)
... 12 more
```

## How to Reproduce?
I've changed a simple application from
```
implementation("ai.djl.pytorch:pytorch-engine:0.16.0")
implementation("ai.djl.pytorch:pytorch-native-auto:1.9.1")
```
to
```
implementation("ai.djl.pytorch:pytorch-engine:0.20.0")
implementation("ai.djl.pytorch:pytorch-native-auto:1.9.1")
```
### Steps to reproduce
Just launch a simple program with this line to initiate the process to load the native libraries
```
Engine.getInstance()
```

## What have you tried to solve it?

These are missing files on your servers I assume, so nothing can be really done other than rollback...

## Environment Info
N/A

Contributor guide

Open the contributing guide

Research direction

Start with ai.djl.pytorch.jni.LibUtils.downloadJniLib and the failing URL shown in the stack trace, then reproduce the problem with Engine.getInstance() using the listed dependency versions. Verify whether the 0.20.0 native library is available for linux-x86_64/cu111; done means the application can download and load it successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, pytorch
Domain
infrastructure, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.