(path: string)
| 62 | * @param path Path to SavedModel folder. |
| 63 | */ |
| 64 | export 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…