This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-04
Channels
- # announcements (8)
- # babashka (78)
- # beginners (15)
- # calva (6)
- # cider (12)
- # clerk (1)
- # clojure (46)
- # clojure-dev (13)
- # clojure-europe (15)
- # clojure-norway (5)
- # clojure-portugal (1)
- # clojure-uk (1)
- # clojurescript (23)
- # clr (29)
- # conjure (4)
- # core-async (10)
- # cryogen (1)
- # data-science (8)
- # hoplon (4)
- # hyperfiddle (11)
- # introduce-yourself (3)
- # jobs (6)
- # kaocha (12)
- # lsp (11)
- # malli (8)
- # membrane (11)
- # releases (1)
- # shadow-cljs (20)
- # spacemacs (47)
- # tools-deps (1)
Hey! I have a ML model trained in PyTorch, and I'm entertaining the possibility of running it in a clojure app. Is there any previous art that I can take a look at? Is there a way of using an ONNX (Open Neural Network Exchange) model via Clojure (cpu is fine)? I'm not familiar with the clojure NN landscape. ☺️
MXNET should support ONNX and there is a Clojure wrapping which I think is official.
The "main" Clojure NN space is probably Dragan's DeepDiamond, which sits on top of Intel's OneAPI for NN and also MKL (which is directly supported by Neanderthal.). DeepDiamond supports many typical things like CNNs, LSTMs, GRUs, various batching, dropouts, etc.
There is also https://github.com/scicloj/clj-djl - I think this is definitely capable. You can also use it from python with libpython-clj although torch has presented issues in the past - there are work arounds.
Way back in the day cortex would have been able to do this but that hasn't been maintained in forever. It is definitely possible with or without GPU acceleration so let us know if you get stuck.
libpython-clj is probably the most straighforward
The torch issue I have seen only in very specific situations and at model 'training' only. Inference should work well.