我使用自己的映像重新训练了一个移动v2 modell,我可以用python (retraining)中的输出来标记新的图像。加载文件可以工作,但在预测期间,它会失败(火狐和铬的concole.log):
The dict provided in model.execute(dict) has keys: [images] not part of model graph.我使用提供的retrain.py重新培训了一个modell
python retrain.py --image_dir flower_photos/ --tfhub_module https://tfhub.dev/google/imagenet/mobilenet_v2_100_224/classification/2 --random_brightness 10 --how_many_training_steps 100在flower_photos中,有带有图像名称的文件夹和相应的图像。
flower_photos
-胡比蒂奇
- 1.jpg
- 2.jpg
……
- 1.jpg
- 2.jpg
我可以用
tensorflowjs_converter --input_format=tf_frozen_model --output_node_names='module_apply_default/MobilenetV2/Logits/output' /tmp/output_graph.pb Mobilenetv2/web_model但在https://github.com/tensorflow/tfjs-examples/tree/master/mobilenet提供的示例中,这是行不通的。
如果我将原始移动集v2转换为
tensorflowjs_converter --input_format=tf_hub 'https://tfhub.dev/google/imagenet/mobilenet_v2_100_224/classification/2' mobilenetv2/web_model我可以在提供的示例中加载。
最后,该方案应检测不同的早盛开花卉显示的网络摄像头和分类。这应该是一个PWA的学生,并激励他们体验自然。
发布于 2019-01-28 17:04:19
Tensorflow.js目前有两种型号,
下面是一个加载冻结模型并对图像执行预测的示例。https://github.com/tensorflow/tfjs-converter/tree/master/demo/mobilenet
https://stackoverflow.com/questions/54392232
复制相似问题