主要的解决思路有三个:
-
- 使用DJL框架,把pytorch模型转化成在java中能用的模型。
参考:https://blog.csdn.net/weixin_43401230/article/details/126021623
https://docs.djl.ai/ (这是官网)
- 使用DJL框架,把pytorch模型转化成在java中能用的模型。
-
第二种方式是大家微服务系统,pythonWeb启动个服务。
参考:https://blog.csdn.net/m0_46503651/article/details/106974051
https://blog.csdn.net/m0_46503651/article/details/108555082 -
第三种方法是通过socket实现进程之间的通信(其实和第二种类似)
参考:https://www.cnblogs.com/maosonglin/p/9397257.html