Closed AtulCIS closed 5 years ago
@AtulCIS, You can refer the section "Fine-tune InceptionV3 on a new set of classes" in the official docs.
Thanks @taehoonlee for the reply. Yes I tried it and when I did that I got the model for my 5 new classes and all the data for 1000 categories disappeared.
@AtulCIS, Then, you can try the following:
base_model = InceptionV3(weights='imagenet')
x = base_model.layers[-k].output
x = GlobalAveragePooling2D()(x)
predictions = Dense(5, activation='softmax')(x)
your_model = Model(inputs=base_model.input, outputs=predictions)
Ok let me try this.
Hi @taehoonlee, What will be the value for "k" in above code ?
The last 4D feature map. An index "k" depends on a model.
Ok so can you please tell in my case what value I can use ? for eg. k=5 ?
I think you need to figure it out.
Hello, I am trying to fine tune InceptionResNetV2 model and I want to add few more classes in it like Watermelon, tomato etc so I tried many ways and every time I am getting an error "a 2D array of shape (samples, 1000)). Found array with shape: 5", so Is it possible to add new classes in existing model or how can I merge my new trained model with InceptionResNetV2 ?