kerasで作ったモデルをcoremltoolsでmlmodelに変換しようとした際でたエラーを解決したいです
元のモデルは以下のようなモデルです
def wavenetModel(input_size) :
filter_count = 10
output_count = 1
def residual_block(i, j):
def f(x):
original_x = x
tanh_out = Conv1D(filter_count, kernel_size=2,
strides=1, padding="causal",
dilation_rate=2**j, use_bias=False,
kernel_regularizer=l2(0.))(x)
tanh_out = Activation("tanh")(tanh_out)
sigm_out = Conv1D(filter_count, kernel_size=2,
strides=1, padding="causal",
dilation_rate=2**j, use_bias=False,
kernel_regularizer=l2(0.))(x)
sigm_out = Activation("sigmoid")(sigm_out)
x = Multiply()([tanh_out, sigm_out])
res_x = Conv1D(filter_count, 1, padding="same", use_bias=False,
kernel_regularizer=l2(0.))(x)
skip_x = Conv1D(filter_count, 1, padding="same", use_bias=False,
kernel_regularizer=l2(0.))(x)
res_x = Add()([original_x, res_x])
return res_x, skip_x
return f
input = Input(shape=(input_size,))
out = input
out = Reshape((input_size, 1))(out)
skip_connections = []
out = Conv1D(filter_count, 2, dilation_rate=1, padding="causal")(out)
for i in range(4):
for j in range(0, 9+1):
out, skip_out = residual_block(i, j)(out)
skip_connections.append(skip_out)
out = Add()(skip_connections)
out = Activation("relu")(out)
out = Conv1D(filter_count, 1, padding="same", kernel_regularizer=l2(0.))(out)
out = Activation("relu")(out)
out = Conv1D(filter_count, 1, padding="same")(out)
out = Conv1D(output_count, 1, padding="same", activation="tanh")(out)
out = Flatten()(out)
model = Model(input, out)
return model
これを保存したh5ファイルをcoremltoolsを使ってmlmodelに変換しようとした際
/.pyenv/versions/3.6.2/lib/python3.6/site-packages/coremltools/models/model.py:109: RuntimeWarning: You will not be able to run predict() on this Core ML model.Underlying exception message was: Error compiling model: "Error reading protobuf spec. validator error: Layer 'conv1d_3__causal_pad__' produces an output named 'conv1d_1_output__causal_pad__' which is also an output produced by the layer 'conv1d_2__causal_pad__'.".
RuntimeWarning)
とのエラーが表示されます
解決方法をお教えください。