【问题标题】:I got an error "TypeError: Cannot read property 'producer' of undefined" in Tensorflowjs tf.loadGraphModel我在 Tensorflowjs tf.loadGraphModel 中收到错误“TypeError: Cannot read property 'producer' of undefined”
【发布时间】:2020-03-29 15:49:03
【问题描述】:

我正在 Google Colab 上使用 ssd_mobilenet_v2_coco_2018_03_29 进行微调。 我遇到了麻烦,因为 Javascript 无法读取 Tensorflowjs_converter 转换的模型。

tensorflowjs==1.3.1

tensorflowjs_converter \
    --input_format=tf_saved_model \
    --output_format=tfjs_graph_model \
    --output_node_names='num_detections,detection_boxes,detection_scores,detection_classes,detection_masks' \
    --signature_name=serving_default \
    --saved_model_tags=serve \
    ./saved_model \
    ./web_model

“web_model”目录列表

-rw-r--r-- 1 root root 4194304 Nov  2 03:24 group1-shard1of5.bin
-rw-r--r-- 1 root root 4194304 Nov  2 03:24 group1-shard2of5.bin
-rw-r--r-- 1 root root 4194304 Nov  2 03:24 group1-shard3of5.bin
-rw-r--r-- 1 root root 4194304 Nov  2 03:24 group1-shard4of5.bin
-rw-r--r-- 1 root root 1753480 Nov  2 03:24 group1-shard5of5.bin
-rw-r--r-- 1 root root  303953 Nov  2 03:24 model.json

HTML

... var model = await tf.loadGraphModel('https://domain/web_model/model.json');

错误

tfjs@1.3.1:2 Uncaught (in promise) TypeError: Cannot read property 'producer' of undefined 在 t。 (tfjs@1.3.1:2) 在 tfjs@1.3.1:2 在 Object.next (tfjs@1.3.1:2) 在 o (tfjs@1.3.1:2)

不知道是版本不好还是转换不好。如果你认识任何人,请告诉我。

【问题讨论】:

    标签: javascript tensorflow


    【解决方案1】:

    试试loadLayersModel:

    const model = await tf.loadLayersModel('https://domain/web_model/model.json')
    

    取自here

    【讨论】:

      猜你喜欢
      • 2020-09-20
      • 2023-02-22
      • 2021-09-25
      • 1970-01-01
      • 2021-10-20
      • 1970-01-01
      • 2019-04-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多