I am using TensorFlow.js and I am interested in gettings the embeddings instead of the logits of a pre-trained model just as described in https://github.com/tensorflow/tfjs-models/tree/master/mobilenet for MobileNet ('Getting embeddings')
With the classic MobileNet model loaded const model = await mobilenet.load() you can use model.infer(image, 'conv_preds') for example and it works fine and you can do your transfer learning.
However, the infer method is not available for an offline model that I load using loadLayersModel(). After some looking around (for example), I have tried accessing the layer's output with get_layer but to no success.
Will I need to create and export a new model which outputs the layer that interests me that I then load as a new layersModel and use? Is there no other way?
Any advice would be appreciated