im trying to do text classification, loaded the model back to browser by
(我试图进行文本分类,通过以下方式将模型加载回浏览器)
async function loadFile(){ const jsonUpload = document.getElementById('json-upload');
model = await tf.loadLayersModel(tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));
model.summary();
have complete summary in console
(在控制台中有完整的摘要)
Layer (type) Output shape Param #
tfjs@latest:2 =================================================================
tfjs@latest:2 embedding_Embedding1 (Embedd [null,15,50] 1009200
tfjs@latest:2 _________________________________________________________________
tfjs@latest:2 conv1d_Conv1D1 (Conv1D) [null,15,100] 15100
tfjs@latest:2 _________________________________________________________________
tfjs@latest:2 max_pooling1d_MaxPooling1D1 [null,7,100] 0
tfjs@latest:2 _________________________________________________________________
tfjs@latest:2 conv1d_Conv1D2 (Conv1D) [null,7,100] 40100
tfjs@latest:2 _________________________________________________________________
tfjs@latest:2 max_pooling1d_MaxPooling1D2 [null,3,100] 0
tfjs@latest:2 _________________________________________________________________
....
...
..
dense_Dense26 (Dense) [null,2] 42
tfjs@latest:2 =================================================================
tfjs@latest:2 Total params: 1702322
tfjs@latest:2 Trainable params: 1702322
tfjs@latest:2 Non-trainable params: 0
tfjs@latest:2
- is there any other way we can check if the model is loaded properly?
(还有什么其他方法可以检查模型是否正确加载?)
ask by TKK translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…