The syntax for adding Convolution2D layer is Keras is https://keras.io/layers/convolutional/#convolution2d. I am unable to pass "weights" argument correctly. How should I do that?
1
votes
2 Answers
1
votes
0
votes
You should pass a list of numpy arrays to set as initial weights.
For Convolution2D, weights list have two items, one in shape (nb_filter, nb_channel, nb_row, nb_col) and bias in shape (nb_filter,).
According to the author of Keras:
If you have doubts about what these shapes are, you can simply instantiate your layer then call
get_weights(), and look at the output. The argument weights, and also the methodset_weights(weights), expect exactly the same format as the output ofget_weights().