I have used this converter to convert a Caffe model to Keras. But one of my layers is of type slice
and it needs to be converted as well but the converter currently does not support this and raises an exception. Is there any work around for it? Here is my layer:
layer {
name: "slice_label"
type: SLICE
bottom: "label"
top: "label_wpqr"
top: "label_xyz"
slice_param {
slice_dim: 1
slice_point: 4
}
}
It seems that you want to use a Lambda
layer. In this case you may do the following:
sliced = Lambda(lambda x: x[:,slicing_indeces], output_shape=(sliced_shape))(input)
Note that in x
you need to take into account the samples axis whereas in output_shape
it's not needed anymore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With