Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Saving .h5 file to SQL database

I've built a few neural networks using Python/Keras. I save the weights on my local machine the standard Keras way, as .h5 files. I'm not too familiar with the h5/hdf5 protocol, but I would like to save these .h5 files to my SQL database, where my data is.

Currently, I'm just saving the paths - is there a way to blob .h5 files to SQL Server?

like image 540
mk8efz Avatar asked Jan 19 '26 18:01

mk8efz


1 Answers

You can save the h5 file to sql server under varbinary(max) data type. If you are looking for the insert query:

INSERT INTO [model_table]
       ([model_weights])
 VALUES
       ((SELECT * FROM OPENROWSET (BULK 'C:\Path\to\model_weights.h5', SINGLE_BLOB) AS X))
like image 139
Devendra Soni Avatar answered Jan 21 '26 07:01

Devendra Soni