Is there a lightweight version of Tensorflow to load a model in production?

Viewed 51

I have a TensorFlow model that I use to make predictions via API. Currently, I have to use the full version of TensorFlow, which is nearly 1GB! I am only using:

from tensorflow.keras.models import load_model

model = load_model(
    "/tmp/current_model", 
    custom_objects=None,
    compile=True
)

predictions = model.predict(inputs, batch_size=1, verbose=1, steps=None, callbacks=None)

Is there a version or strategy to load a model & predict() that doesn't require the entire 1GB Tensorflow package? This no longer requires any of the training functionality.

0 Answers
Related