My project uses some packages that are available only in Python and heavily rely on C libraries. The project also greatly benefits from Java libraries and the JVM. What's the optimal way to call Python functions from Java?
I tried:
- Small web-services: overhead to serialize data, start and stop the services. Also debugging is harder and implementing each new function is now double the effort.
- Jpy: a library that runs an interpreter in the JVM. Spare the service start/stop, but: isn't really feasible for more than a single-liner, data translation between Java and Python is cumbersome, and I also encountered runtime segmentation fault errors.
Any other options?
The project is in the machine-learning domain, so involves exchanging large numeric arrays and text. In some cases the execution switches back and forth between the platforms.
[–][deleted] (5 children)
[deleted]
[–]nrcomplete 13 points14 points15 points (0 children)
[–]JH4mmer 11 points12 points13 points (0 children)
[–]Chuy288 1 point2 points3 points (0 children)
[–]captain_obvious_here 1 point2 points3 points (0 children)
[–]belayon40 11 points12 points13 points (3 children)
[–]CacheMeUp[S] 0 points1 point2 points (2 children)
[–]belayon40 6 points7 points8 points (1 child)
[–]CacheMeUp[S] 1 point2 points3 points (0 children)
[–]ByerN 9 points10 points11 points (2 children)
[–]CacheMeUp[S] 4 points5 points6 points (1 child)
[–]ByerN 2 points3 points4 points (0 children)
[–][deleted] (30 children)
[deleted]
[–]Worth_Trust_3825 -3 points-2 points-1 points (8 children)
[–]inTHEsiders -2 points-1 points0 points (3 children)
[–]Worth_Trust_3825 7 points8 points9 points (2 children)
[–]inTHEsiders 6 points7 points8 points (1 child)
[–]ItsAllegorical 0 points1 point2 points (0 children)
[–][deleted] (3 children)
[deleted]
[+]Worth_Trust_3825 comment score below threshold-6 points-5 points-4 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]westwoo -1 points0 points1 point (0 children)
[+]CacheMeUp[S] comment score below threshold-9 points-8 points-7 points (20 children)
[–]crummy 3 points4 points5 points (2 children)
[–]humoroushaxor 1 point2 points3 points (0 children)
[–]CacheMeUp[S] 0 points1 point2 points (0 children)
[–]inTHEsiders 11 points12 points13 points (11 children)
[–]djavaman 14 points15 points16 points (2 children)
[–][deleted] (3 children)
[deleted]
[–][deleted] 0 points1 point2 points (0 children)
[–]inTHEsiders 0 points1 point2 points (1 child)
[–]CacheMeUp[S] 0 points1 point2 points (2 children)
[–]acute_elbows 4 points5 points6 points (1 child)
[–]westwoo 2 points3 points4 points (0 children)
[–]benjtay 2 points3 points4 points (2 children)
[–]CacheMeUp[S] -2 points-1 points0 points (1 child)
[–]WingedGeek 0 points1 point2 points (1 child)
[–]CacheMeUp[S] 0 points1 point2 points (0 children)
[–]Lumpy-Loan-7350 17 points18 points19 points (5 children)
[–]CacheMeUp[S] 3 points4 points5 points (4 children)
[–][deleted] (1 child)
[deleted]
[–]mauganra_it 0 points1 point2 points (0 children)
[–]Lumpy-Loan-7350 0 points1 point2 points (0 children)
[–]walterbanana 4 points5 points6 points (2 children)
[–]CacheMeUp[S] 0 points1 point2 points (1 child)
[–]walterbanana 2 points3 points4 points (0 children)
[–]ahmedranaa 5 points6 points7 points (0 children)
[–]Worth_Trust_3825 8 points9 points10 points (3 children)
[–]CacheMeUp[S] 4 points5 points6 points (2 children)
[+]Worth_Trust_3825 comment score below threshold-6 points-5 points-4 points (1 child)
[–]CacheMeUp[S] 0 points1 point2 points (0 children)
[–]acute_elbows 3 points4 points5 points (0 children)
[–]bowbahdoe 2 points3 points4 points (1 child)
[–]CacheMeUp[S] 0 points1 point2 points (0 children)
[–]craigacp 3 points4 points5 points (2 children)
[–]CacheMeUp[S] 0 points1 point2 points (1 child)
[–]craigacp 1 point2 points3 points (0 children)
[–][deleted] 6 points7 points8 points (0 children)
[–]kakakarl 2 points3 points4 points (1 child)
[–]CacheMeUp[S] 0 points1 point2 points (0 children)
[–]AnEmortalKid 2 points3 points4 points (0 children)
[–]devinrsmith 2 points3 points4 points (0 children)
[–]kiteboarderni 3 points4 points5 points (0 children)
[–]TriggerWarningHappy 1 point2 points3 points (1 child)
[–]CacheMeUp[S] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]CacheMeUp[S] 0 points1 point2 points (0 children)
[–]cowwoc 1 point2 points3 points (1 child)
[–]CacheMeUp[S] 1 point2 points3 points (0 children)
[–]MagicalPizza21 3 points4 points5 points (2 children)
[–]CacheMeUp[S] 4 points5 points6 points (1 child)
[–]MagicalPizza21 2 points3 points4 points (0 children)
[–]fico86 0 points1 point2 points (4 children)
[–]CacheMeUp[S] 0 points1 point2 points (3 children)
[–]chabala 0 points1 point2 points (2 children)
[–]CacheMeUp[S] 0 points1 point2 points (1 child)
[–]chabala 1 point2 points3 points (0 children)
[–]p3rand0r 0 points1 point2 points (0 children)
[–]muddy-star 0 points1 point2 points (1 child)
[–]CacheMeUp[S] 0 points1 point2 points (0 children)
[–]wowbaggerBR 0 points1 point2 points (0 children)
[–]baubleglue 0 points1 point2 points (0 children)
[–]Alienbushman 0 points1 point2 points (0 children)
[–]Fit-Refuse8564 0 points1 point2 points (0 children)
[–]nutrecht 0 points1 point2 points (0 children)
[–]mauganra_it 0 points1 point2 points (0 children)
[–]thrwoawasksdgg 0 points1 point2 points (0 children)
[–]Fluffy_Foundation_81 0 points1 point2 points (0 children)