Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
amazon sagemaker中提供的tensorflow:_MklConcatOp在连接两个嵌入张量时出错(一个形状(无,6,8),另一个形状(无,6,4))_Tensorflow_Keras_Amazon Sagemaker_Tensorflow Serving - Fatal编程技术网

amazon sagemaker中提供的tensorflow:_MklConcatOp在连接两个嵌入张量时出错(一个形状(无,6,8),另一个形状(无,6,4))

amazon sagemaker中提供的tensorflow:_MklConcatOp在连接两个嵌入张量时出错(一个形状(无,6,8),另一个形状(无,6,4)),tensorflow,keras,amazon-sagemaker,tensorflow-serving,Tensorflow,Keras,Amazon Sagemaker,Tensorflow Serving,我在AWS SageMaker上提供tensorflow模型时面临一个问题。我的tensorflow代码: feature_1 = layers.Input(shape=(6, ), name="f1", dtype="int32") feature_2 = layers.Input(shape=(6, ), name="f2", dtype="int32") embedding_1 = layers.Embedd

我在AWS SageMaker上提供tensorflow模型时面临一个问题。我的tensorflow代码:

feature_1 = layers.Input(shape=(6, ), name="f1", dtype="int32")
feature_2 = layers.Input(shape=(6, ), name="f2", dtype="int32")

embedding_1 = layers.Embedding(input_dim=5000, output_dim=8, mask_zero=True)
embedding_2 = layers.Embedding(input_dim=100, output_dim=4, mask_zero=True)


masked_output_1 = embedding_1(feature_1)
masked_output_2 = embedding_2(feature_2)


concate = tf.keras.layers.Concatenate(axis=-1)([masked_output_1, masked_output_2])

dnn1 = tf.reduce_sum(concate, axis=1)

dnn = tf.keras.layers.Dense(4, activation="relu")(dnn1)

output = tf.keras.layers.Dense(1, activation="sigmoid")(dnn)
使用Python的predict接口或使用保存的\u model\u cli命令没有问题。使用tensorflow/serving启动本地RSET服务没有问题。 但当我将模型部署到Amazon SageMaker时,调用predict接口将报告以下错误:

"_MklConcatOp : Dimensions of inputs should match: shape[0][3]= 8 vs. shape[1][3] = 4\n\t [[{{node StatefulPartitionedCall/StatefulPartitionedCall/model/concatenate/concat}}]]"