出错原因: IN = InputLayer(x) 分析原因: tf.keras.layers.Input()输入层解析: 定义网络的输入尺寸,输入尺寸出现错误。 获取尺寸tf.shape(x)出现的问题,改成x.get_shape().as_list()。 解决!