Skip to content
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

Exception with retrieving output tensors from TorchScript model #56

Open
bsbodden opened this issue Jul 22, 2021 · 2 comments
Open

Exception with retrieving output tensors from TorchScript model #56

bsbodden opened this issue Jul 22, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@bsbodden
Copy link

bsbodden commented Jul 22, 2021

Version

 <dependency>
    <groupId>com.redislabs</groupId>
    <artifactId>jredisai</artifactId>
    <version>1.0.0-SNAPSHOT</version>
 </dependency>

Reproducer Project

Project containing a test to replicate the issue: [https://github.com/bsbodden/redisai-torch-test](https://github.com/bsbodden/redisai-torch-test)

Issue/Exception with retrieving output tensors

The test class RunModelsTest has two test methods:

🟢 testRunTensorFlowModel: original method from JRedisAI test suite - PASS
🔴 testRunTorchScriptModel: the method in question - FAIL

Using RedisAI docker image edge

docker run -p 6379:6379 --name redisai redislabs/redisai:edge-cpu

Module List

127.0.0.1:6379> MODULE LIST
1) 1) "name"
   2) "ai"
   3) "ver"
   4) (integer) 999999

Docker Image info

edge-cpu | 30b1cdcdbd52

Run with

./mvnw clean verify

The method loads a TorchScript pre-trained model that was created using https://github.com/redis-developer/redisai-iris

[ERROR] testRunTorchScriptModel  Time elapsed: 0.081 s  <<< ERROR!
java.lang.ClassCastException: java.lang.Long incompatible with [B
	at com.redislabs.ai.RunModelsTest.testRunTorchScriptModel(RunModelsTest.java:63)

The error happens on this line:

// AI.TENSORGET iris:inferences VALUES
Tensor inferences = client.getTensor("iris:inferences"); // 💥
@sazzad16
Copy link
Collaborator

@bsbodden Did you try the test on redisai:edge-cpu-bionic image?

@bsbodden
Copy link
Author

-cpu-bionic

Just did. Same result.

@gkorland gkorland added the bug Something isn't working label Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants