首页 > 解决方案 > Currently trying to use my MobileNet in a web application, nothing seems to work

问题描述

EDIT: The issue was the h5 file I saved before converting to tfjs. If you try something similar use the method save instead of save_weights when saving your keras model.

My project is supposed to identify me or my friends in any given image. I have trained a Mobile CNN made with keras and transformed it with tensorflowjs like so

I have followed a few tutorials and I still can't understand why my model won't load. This is part of my script:

let model;

async function loadMyModel() {
  model = undefined;

  model = await tf.loadLayersModel("https://consumingtoast.github.io/SelfieTime/model/model.json");
  $('.progress-bar').hide();
  alert("model loaded..");

}

try {
  loadMyModel();
} catch {
  alert("Something went wrong");
}

标签: javascripttensorflowneural-networktensorflow.jsconv-neural-network

解决方案


推荐阅读