0

通过转换保存的模型,我被卡住了几天:

$ tensorflowjs_converter --input_format=tf_saved_model --output_node_names='detection_boxes,detection_classes,detection_scores,num_detections' --skip_op_check=SKIP_OP_CHECK ./saved_model  ./web_model
Using TensorFlow backend.
2019-02-20 08:49:48.827375: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-02-20 08:49:52.385385: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:501] Optimization results for grappler item: graph_to_optimize
2019-02-20 08:49:52.385410: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   debug_stripper: Graph size after: 2419 nodes (0), 2842 edges (0), time = 15.828ms.
2019-02-20 08:49:52.385416: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   model_pruner: Graph size after: 2212 nodes (-207), 2635 edges (-207), time = 39.354ms.
2019-02-20 08:49:52.385421: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   constant folding: Graph size after: 1039 nodes (-1173), 1273 edges (-1362), time = 249.663ms.
2019-02-20 08:49:52.385425: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   arithmetic_optimizer: Graph size after: 782 nodes (-257), 1239 edges (-34), time = 108.649ms.
2019-02-20 08:49:52.385429: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   dependency_optimizer: Graph size after: 729 nodes (-53), 1139 edges (-100), time = 19.787ms.
2019-02-20 08:49:52.385495: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   model_pruner: Graph size after: 729 nodes (0), 1139 edges (0), time = 8.716ms.
2019-02-20 08:49:52.385506: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   remapper: Graph size after: 974 nodes (245), 1419 edges (280), time = 50.844ms.
2019-02-20 08:49:52.385512: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   constant folding: Graph size after: 647 nodes (-327), 1056 edges (-363), time = 237.244ms.
2019-02-20 08:49:52.385516: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   arithmetic_optimizer: Graph size after: 647 nodes (0), 1056 edges (0), time = 73.777ms.
2019-02-20 08:49:52.385521: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   dependency_optimizer: Graph size after: 647 nodes (0), 1056 edges (0), time = 16.117ms.
2019-02-20 08:49:52.385525: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   debug_stripper: Graph size after: 647 nodes (0), 1056 edges (0), time = 5.789ms.
2019-02-20 08:49:52.385530: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   model_pruner: Graph size after: 647 nodes (0), 1056 edges (0), time = 7.263ms.
2019-02-20 08:49:52.385534: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   constant folding: Graph size after: 647 nodes (0), 1056 edges (0), time = 74.943ms.
2019-02-20 08:49:52.385538: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   arithmetic_optimizer: Graph size after: 647 nodes (0), 1056 edges (0), time = 78.973ms.
2019-02-20 08:49:52.385543: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   dependency_optimizer: Graph size after: 647 nodes (0), 1056 edges (0), time = 17.675ms.
2019-02-20 08:49:52.385547: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   model_pruner: Graph size after: 647 nodes (0), 1056 edges (0), time = 6.868ms.
2019-02-20 08:49:52.385551: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   remapper: Graph size after: 647 nodes (0), 1056 edges (0), time = 7.687ms.
2019-02-20 08:49:52.385556: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   constant folding: Graph size after: 647 nodes (0), 1056 edges (0), time = 72.413ms.
2019-02-20 08:49:52.385561: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   arithmetic_optimizer: Graph size after: 647 nodes (0), 1056 edges (0), time = 78.796ms.
2019-02-20 08:49:52.385565: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:503]   dependency_optimizer: Graph size after: 647 nodes (0), 1056 edges (0), time = 16.332ms.
Writing weight file ./web_model/tensorflowjs_model.pb...
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/tensorflowjs_converter", line 10, in <module> sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflowjs/converters/converter.py", line 322, in main strip_debug_ops=FLAGS.strip_debug_ops)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflowjs/converters/tf_saved_model_conversion_pb.py", line 294, in convert_tf_saved_model skip_op_check=skip_op_check, strip_debug_ops=strip_debug_ops)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflowjs/converters/tf_saved_model_conversion_pb.py", line 138, in optimize_graph extract_weights(optimized_graph, output_graph, quantization_dtype)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflowjs/converters/tf_saved_model_conversion_pb.py", line 182, in extract_weights[ const_manifest], path, quantization_dtype=quantization_dtype)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflowjs/write_weights.py", line 119, in write_weights group_bytes, total_bytes, _ = _stack_group_bytes(group)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflowjs/write_weights.py", line 196, in _stack_group_bytes _assert_valid_weight_entry(entry)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflowjs/write_weights.py", line 305, in _assert_valid_weight_entry data.dtype.name + ' not supported.')
ValueError: Error dumping weight Equal/y, dtype string24 not supported.

(张量流 0.8.0)

有人可以建议我在哪里/搜索什么以避免此错误吗?

4

0 回答 0