Reputation: 1
I am trying to build a decoder which requires Conv2DTranspose , but tensorflow iOS does not have operation MUL for int32 types. Is there a way I can change the data type of the input to MUL in my protobuf file or in keras saved model?
Upvotes: 0
Views: 2945
Reputation: 86600
In the creation of the model:
K.cast(tensor, K.floatx())
tf.cast(tensor, tf.float32)
If the model is already created, replicate it, adding the operation at the right place (when in Keras, use a Lambda
layer for that: Lambda(lambda x: K.cast(x,K.floatx()))
), and transfer its weights (newModel.set_weights(oldModel.get_weights())
).
Upvotes: 4