The problem:
I'm trying to deploy an application that uses machine learning over an infrastructure (namely, Deta Space [https://deta.space/]). However, the resource limit they make available is around 250MB and this has been a problem for me. To run a digit classifier model (trained on the MNIST base), I used Scikit-learn (a MLP network and a SGD model), in its latest version. When I created a virtual environment, I noticed that it, including its dependencies, consumed about 248 MB. Therefore, when I try to deploy my application in Deta Space, it generates an error that exceeds the space limit since, in addition to Sciki-learn, I will have to use Flask, among others. Now, would you have any suggestions on how to tackle this problem?
Attempts made so far (and without success):
1. Make a version of the classifier model with Tensorflow and use Tensor flow Lite.
Results:
- The amount of resources (i.e. libraries and dependencies installed in the environment) falls below the 250 MB limit.
- The Deta Space backend generates the following error:
Error Type: ImportError
Error Message: /lib64/libm.so.6: version GLIBC_2.27 not found (required by /opt/python/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so)
Note: I researched the subject and tried to downgrade Tensorflow Lite, but the problem persists. I believe they don't provide any glib support that Tensorflow Lite needs.
2. I tried to export/transpile the model from Sciki-learn to JavaScript, using the scikit-porter package [https://pypi.org/project/sklearn-porter/].
Results:
- The library is outdated and has errors when using the generated model. The official, unmaintained Github has been around for quite some time.
Attempts in progress:
- Evaluate the possibility of using a specific implementation (without any framework but on Python) for the classifier model.
The challenge will be to generate a python environment with less than 250 MB that allows running models made in python with Sciki-learn or Tensor-flow.
I appreciate anyone who can collaborate!