【发布时间】:2020-05-03 02:26:33
【问题描述】:
我正在尝试通过下面的代码在这里创建一个 CNN + 回归模型:
# Create the base model from the pre-trained model MobileNet V2
cnn_model = keras.applications.MobileNetV2(input_shape=IMG_SHAPE,
include_top=False,
weights='imagenet')
# The Regression Model
regression_model = keras.Sequential([
keras.layers.Dense(64, activation='relu',
input_shape=cnn_model.output_shape),
keras.layers.Dense(64, activation='relu')
])
prediction_layer = tf.keras.layers.Dense(1)
# Final Model
model = keras.Sequential([
cnn_model,
regression_model,
prediction_layer
])
现在的问题是我收到以下警告:
警告:tensorflow:模型是用形状构造的 张量("dense_12_input:0", shape=(None, None, 7, 7, 1280), dtype=float32) 用于输入(无、无、7、7、1280),但它是 重新调用形状不兼容的张量 (None, 7, 7, 1280)。
有没有人知道为什么会出现这个警告以及我可以如何应对它,除非它是无害的。
【问题讨论】:
标签: python tensorflow keras tensorflow2.0 tf.keras