Deep network training issue: Exception: Owl_exception.NOT_MATRIX(_).
I am trying to follow the example from the MNIST CNN tutorial but replacing the data with my own. However, I'm having issues actually training the network.
I'm attempting an image-to-image mapping.
The data I prepare is of type Owl_dense_ndarray.S.arr, which is the same data type generated from Dataset.load_mnist_train_data_arr.
My network is the following:
conv2d ~padding:SAME kernel stride nn
|> activation Activation.Relu
let make_network input_shape =
input input_shape
|> conv_relu [|3;3;3;32|] [|1;1|]
|> conv_relu [|3;3;32;32|] [|1;1|]
|> conv_relu [|3;3;32;3|] [|1;1|]
|> get_network
And I'm trying to train as follows:
let x, y = dataset in
let net = make_network [|32;32;3|] in
Graph.print net;
let params = Params.config
~batch:(Batch.Mini 32)
~learning_rate:(Learning_Rate.Adagrad 0.005)
0.1
in
Graph.train ~params net x y |> ignore;
net
However, I'm met with this error:
Called from unknown location
Called from unknown location
Called from unknown location
Called from unknown location
Called from unknown location
Called from unknown location
Called from unknown location
I'm running this code in utop on WSL. I'm unsure which part of the input should be "matrix" type.
Also, I would be running this with the exact MNIST example, but I get this issue when doing so:
Exception: (Failure "input_value: unknown custom block identifier")
Raised by primitive operation at unknown location
Called from unknown location
Called from Owl_dataset.load_mnist_train_data in file "src/owl/misc/owl_dataset.ml", line 87, characters 4-54
Called from Owl_dataset.load_mnist_train_data_arr in file "src/owl/misc/owl_dataset.ml", line 110, characters 20-44
Called from unknown location
Called from unknown location
Hi @sremedios, sorry for this very late reply. I just run the same MNIST example in an Owl container, and the result looks normal. According to you log, the "unknown custom block identifier" problem occurs in the Matrix.S.load function, which is a wrapper of Marshall module. My guess is that we have a version mismatch issue here, i.e. trying to read a file that is written with older version of Marshall. The dataset file we built should work fine on OCaml ver. 4.10 or less, but such problems could happen.
Not sure about the "Called from unknown location" problem. Perhaps this thread can be of some help.