Quantus icon indicating copy to clipboard operation
Quantus copied to clipboard

Add support for TF saved model / TF hub models

Open aaarrti opened this issue 3 years ago • 1 comments

In TF it's common practise to use tf.saved_model format, for (de)serialising trained models. This format has however a bit other APIs than tf.keras.Model. It would be great to have Quantus support it.

Also whilst on it, imo it would make sense to also support https://tfhub.dev/, since this is also a popular format for sharing pre-trained TF models

image

aaarrti avatar Aug 13 '22 09:08 aaarrti

Sounds good. Let's sync on it :)

annahedstroem avatar Aug 13 '22 09:08 annahedstroem

So, as per official documentation:

A SavedModel contains a complete TensorFlow program, including trained parameters (i.e, [tf.Variable] (https://www.tensorflow.org/api_docs/python/tf/Variable)s) and computation. It does not require the original model building code to run, which makes it useful for sharing or deploying with TFLite, TensorFlow.js, TensorFlow Serving, or TensorFlow Hub.

Which basically means we get Callable, we can use to run inference, however no access to internals: like layers, activations and we can't modify it's behaviour. Because only (compiled) computational graph is saved.

I'd say it makes no sense to support this. So I'l close the issue, or rather cancel the feature request

aaarrti avatar Sep 11 '22 21:09 aaarrti