How to use a model built with pre-computed features in production?

I’m going through the lesson 7 notebook and wondering what is the recommend practice for using a model trained with pre-computed features on a new image?

Insofar as I can see, there are two options:

  1. Make a prediction against the convolutional model … and then use the result to make a final prediction using the model you trained with the precomputed features of the conv. model. This essentially requires you to go through two steps.

  2. Create a single model by merging the layers of the convolutional model with the one you made. This seems more natural as the image is fed in as is without any need to first precompute the convolutional features.

If there is a better option, I’m all ears.

I think both are valid options. If you’d like one Model to do both, feature extraction and prediction you can go for option two. You would load the pretrained model, fix the weights and add a classifier on top. When you train this model, the feature extraction part (pretrained) remains unchanged while the classifier learns to combine them to make good predictions.