以下の内容はhttps://anton0825.hatenablog.com/entry/2016/09/28/000000より取得しました。


InceptionResNetV2のlayersをSequentialクラスに渡すと「ValueError: Input 0 of layer conv2d_6 is incompatible with the layer」エラー

原因はよく分からないが、Sequential APIでなく、Functional APIを使うと直った。 サンプルコードは以下。

    base_model = tf.keras.applications.inception_resnet_v2.InceptionResNetV2(weights='imagenet', include_top=False, input_shape=(WIDTH, HEIGHT, 3))
    input = Input(shape=(299, 299, 3))
    o = base_model(input)
    o = Flatten()(o)
    o = Dense(256, activation='relu')(o)
    o = Dense(8)(o)
    model = Model(inputs=input, outputs=o)

参考:

github.com




以上の内容はhttps://anton0825.hatenablog.com/entry/2016/09/28/000000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14