MCPcopy Create free account
hub / github.com/tensorflow/tfjs / readSavedModelProto

Function readSavedModelProto

tfjs-node/src/saved_model.ts:64–75  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

62 * @param path Path to SavedModel folder.
63 */
64export async function readSavedModelProto(path: string) {
65 // Load the SavedModel pb file and deserialize it into message.
66 try {
67 fs.accessSync(path + SAVED_MODEL_FILE_NAME, fs.constants.R_OK);
68 } catch (error) {
69 throw new Error(
70 'There is no saved_model.pb file in the directory: ' + path);
71 }
72 const modelFile = await readFile(path + SAVED_MODEL_FILE_NAME);
73 const array = new Uint8Array(modelFile);
74 return messages.SavedModel.deserializeBinary(array);
75}
76
77/**
78 * Inspect the MetaGraphs of the SavedModel from the provided path. This

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…