A URL path to the model. Can be an absolute HTTP path (e.g., 'http://localhost:8000/model-upload)') or a relative path (e.g., './model-upload').
Optional
loadOptions: LoadOptionsOptional configuration for the loading. It includes the following fields:
fetch
function. E.g., in Node.js,
the fetch
from node-fetch can be used here.An instance of IOHandler
.
Creates an IOHandler subtype that sends model artifacts to HTTP server.
An HTTP request of the
multipart/form-data
mime type will be sent to thepath
URL. The form data includes artifacts that represent the topology and/or weights of the model. In the case of Keras-styletf.Model
, two blobs (files) exist in form-data:modelTopology
andweightsManifest
.The following code snippet exemplifies the client-side code that uses this function:
If the default
POST
method is to be used, without any custom parameters such as headers, you can simply pass an HTTP or HTTPS URL tomodel.save
:The following GitHub Gist https://gist.github.com/dsmilkov/1b6046fd6132d7408d5257b0976f7864 implements a server based on flask that can receive the request. Upon receiving the model artifacts via the requst, this particular server reconstitutes instances of Keras Models in memory.