I created a keras model (tensorflow) and want to store it in my MS SQL Server database. What is the best way to do that? pyodbc.Binary(model) throws an error. I would prefer a way without storing the model in the file system first.
Thanks for any help
It seems that there is no clean solution to directly store a model incl. weights into the database. I decided to store the model as h5 file in the filesystem and upload it from there into the database as a backup. For predictions I load anyway the model from the filesystem as it is much faster than getting it from the database for each prediction.
The best approach would be to save it as a file in the system and just save the path in the database. This technique is usually used to store large files like images since databases usually struggle with them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With