I need to call some Python code from Java.
I am aware though that Jython exists or that Java has its own Python interpreter.
Thing is, said Python code uses some native (C) compiled code, even runs something on GPU.
So I can divide this into two questions:
- Does Jython or Java's Python interpreter support this? That is, the Python code (when called from Java) would run with all the C and GPU parts, thus will run roughly as fast as it would on its own.
- If neither of the above mentioned ways support this, is there any other way to do this?
P.S. If that helps, although I suppose it's irrelevant, the code I need to run are highly GPU/C optimized neural networks from Keras (with TensorFlow underneath). I absolutely can't afford to run the only-Python interpreted version.
os.system("command")
java
there are system commands as well that you could use to run python.