uncomplicate / deep-diamond

A fast Clojure Tensor & Deep Learning library
https://aiprobook.com
Eclipse Public License 1.0
428 stars 17 forks source link

No implementation of method: :diamond-factory of protocol: #'uncomplicate.diamond.internal.protocols/DiamondFactoryProvider found for class: nil #4

Closed kongeor closed 3 years ago

kongeor commented 3 years ago

Hello!

trying to test the various examples found on the blog (e.g. https://dragan.rocks/articles/20/Deep-Diamond-Deep-Learning-in-Clojure-is-Fast-and-Simpler-than-Keras) but when setting up the following network:

(def net-spec [(convo [32] [3 3] :relu)
               (convo [64] [3 3] :relu)
               (pooling [2 2] :max)
               (dropout)
               (dense [128] :relu)
               (dropout)
               (dense [10] :softmax)])

(defonce net-bp
         (network (desc [128 1 28 28] :float :nchw)
                  net-spec))

I'm getting:

Execution error (IllegalArgumentException) at uncomplicate.diamond.internal.protocols/eval6180$fn$G (protocols.clj:7).
No implementation of method: :diamond-factory of protocol: #'uncomplicate.diamond.internal.protocols/DiamondFactoryProvider found for class: nil

I'm using [uncomplicate/deep-diamond "0.16.0-alpha"] and [org.bytedeco/mkl-platform-redist "2020.3-1.5.4"].

Any suggestions?

Thanks!

blueberry commented 3 years ago

You need to evaluate the native namespace for the default engine to be initialized. See the same example in the DD test folder.