Tensorflow has several types of model formats:
- TensorFlow SavedModel 2. Frozen Model 3. Session Bundle 4. Tensorflow Hub module
How can you distinguish between them on-disk? (to later use with tensorflowjs-converter)
And how is each model created?
Yup, there are a LOT of different model types, and they all have good reasons. I'm not going to claim that I have perfect clarity of each, but here's what I know (I think I know).
.pb file: PB stands for protobuff or Protocol Buffer. This is the model structure, generally without the trained weights and is stored in a binary format..pbtxt file: Nonbinary of the pb file for human reading..ckpt file, too. The Checkpoint file is the missing set of weights that the pb needs..h5 file: The model + weights from a Keras save.tflite file would be a TensorflowLite model pb with the weights file, so you don't have to manage two of them. Usually, this means adding the word frozen to the filename. I'm sure this can be inferred when loading the file, but on disk they are a bit more on the honor system and no ckpt file. This strips out extraneous graph info; it's basically like the "Production Ready" version of the model.A multi-exported grouping of files looks like this image. From here, you can see quite a few that you could turn into TFJS.