-
Notifications
You must be signed in to change notification settings - Fork 679
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
Running two models with same engine at once #179
Comments
@stu1130 Please take a look. |
Thanks for reporting the issue @tspannhw. |
I found where the error log is but the issue I saw is
|
@tspannhw You are loading two copy of Engine class into different ClassLoader. The 2nd System.load("jnipytorch") will fail. This is expected. A quick workaround would be move DJL libraries into system classloader, directly put them into top level libs folder, and configure them as "provided" dependency. |
@tspannhw we came up with three solutions.
We recommend option 2 as it would be the easiest solution for you. What do you think? |
…ent ClassLoader Change-Id: I60ba3469cc841c2bdb2d1696f2b0926c11db1f37
…ent ClassLoader Change-Id: I60ba3469cc841c2bdb2d1696f2b0926c11db1f37
Change-Id: I60ba3469cc841c2bdb2d1696f2b0926c11db1f37
@tspannhw I created a PR to workaround NiFi ClassLoader issue. The workaround would be:
You can refer to: djl/engines/pytorch/pytorch-engine/src/test/java/ai/djl/pytorch/integration/ALibUtilsTest.java Lines 43 to 45 in 93123ad
We also created a built-in NativeHelper class in ai.djl.pytorch:pytorch-native-XXX package, but you need move this file out of your .nar file and put it into nifi\libs folder. Let me know if you have better way to resolve this issue. |
thanks |
Description
Cannot run two models in NiFi 1.11.4 if both using Pytorch engine.
Expected Behavior
Both should be able to use the library
Error Message
java.lang.UnsatisfiedLinkError: /Users/tspann/.djl.ai/pytorch/1.6.0-cpu-osx-x86_64/0.8.0-SNAPSHOT-cpu-libdjl_torch.dylib (Library is already loaded in another ClassLoader)
How to Reproduce?
https://github.com/tspannhw/nifi-djlsentimentanalysis-processor
Steps to reproduce
(Paste the commands you ran that produced the error.)
What have you tried to solve it?
Environment Info
Run my nifi processors
https://github.com/tspannhw/nifi-djlqa-processor
https://github.com/tspannhw/nifi-djlsentimentanalysis-processor
The text was updated successfully, but these errors were encountered: