Last active
August 28, 2021 17:51
-
-
Save Nithanaroy/7b89309d06b1321776cc92574239e103 to your computer and use it in GitHub Desktop.
Load Tensorflow JS model from Google Drive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function loadModel() { | |
google.script.run.withSuccessHandler(async modelFiles => { | |
const modelJson = new File([modelFiles[0]], "model.json", { type: "application/json" }) | |
const modelWeights = new File([Uint8Array.from(modelFiles[1])], "group1-shard1of1.bin") | |
model = await tf.loadLayersModel(tf.io.browserFiles([modelJson, modelWeights])) | |
model.summary(); | |
}).withFailureHandler(onFailure).loadModelFromDrive(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment