mllite / sklearn2sql_heroku

Heroku web service client for sklearn2sql
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Add support for Keras Models SQL generation #3

Open antoinecarme opened 6 years ago

antoinecarme commented 6 years ago

Allow generation deployment SQL for keras models using this web service.

https://github.com/antoinecarme/keras2sql

Deliverables :

  1. Include keras models,
  2. SQL generation and
  3. the necessary tests,
  4. sample python/keras script
antoinecarme commented 6 years ago

Need to :

  1. serialize the trained keras model (json + hdf or using pickle, not easy)
  2. send the serialized model through the web service (easy).
  3. read back the request result and extract the SQL code.
antoinecarme commented 6 years ago

Added some issue for making keras models picklable :

https://github.com/keras-team/keras/issues/10475

Some serious effort already started :

https://github.com/keras-team/keras/pull/10483

antoinecarme commented 3 years ago

As of 2021-05-04 , Keras models do not pickle properly, the test script

https://github.com/antoinecarme/keras2sql/blob/master/test_client.py

which builds a simple RNN classification model on the iris dataset fails to pickle with the following error

Traceback (most recent call last):
  File "/home/antoine/dev/python/packages/sql_deploy/keras2sql/test_client.py", line 64, in <module>
    pickle_data = pickle.dumps(clf)
TypeError: cannot pickle 'weakref' object

Keep the faith that such an issue be solved someday.

https://github.com/keras-team/keras/issues/10475