The added layer must be an instance of class Layer. Found:

后端 未结 3 614
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-15 18:15

I am new to machine learning. I was following this tutorial on fine-tuning VGG16 models.

The model loaded fine with this code:

vgg_model = tensorflow.k         


        
3条回答
  •  抹茶落季
    2020-12-15 18:40

    This won't work because a tensorflow.keras layer is getting added to a keras Model.

    vgg_model = tensorflow.keras.applications.vgg16.VGG16()
    model = keras.Sequential()
    model.add(vgg_model.layers[0])
    

    Instantiate tensorflow.keras.Sequential(). This will work.

    model = tensorflow.keras.Sequential()
    model.add(vgg_model.layers[0])
    

提交回复
热议问题