Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split layers without Lambda #8618

Closed
mercy0387 opened this issue Nov 29, 2017 · 1 comment
Closed

Split layers without Lambda #8618

mercy0387 opened this issue Nov 29, 2017 · 1 comment

Comments

@mercy0387
Copy link

I build the model which has split and concat in itself. This issue ( #890 ) is very helpful for me but there's a problem.

I want to use my model in iOS App. So I tried to convert keras model to coreML model using coremltools.
But coreML does not accept Lambda layers like this ...

ValueError: Keras layer '<class 'keras.layers.core.Lambda'>' not supported. 

I just want to do

input1 = Lambda(lambda x: x[:, :5], output_shape=(5,))(one_input)
input2 = Lambda(lambda x: x[:, 5:], output_shape=(5,))(one_input)

and after some manipulation

output = Concatenate()([layer1, layer2])

Is there work around for this without using Lambda?

@mercy0387
Copy link
Author

mercy0387 commented Nov 29, 2017

I think I can say the same thing to backend functions.

layer = Lambda(lambda x: K.sqrt(x))(input_layer)

Can I use alternative layers like these in coreML?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants