我已经在我的机器(cpu机器)中安装了来自source的tensorflow而没有cuda支持, 所以我想将一个样本tensorflow模型转换为tflite,但是当我想将检查点与.pg图形合并时,我发现了以下错误:
命令行:
~/tensorflow/tensorflow/python/tools$** python freeze_graph.py --input_graph=/home/hamza/object_detection/saved_model1/frozen_inference_graph.pb --input_checkpoint=~/object_detection/saved_model1/model.ckpt --input_binary=true --output_graph=~/object_detection/saved_model1/frozen_graph.pb --output_node_names=ObjectRes
输出错误:
2018-05-22 09:18:32.403770: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
Traceback (most recent call last):
File "freeze_graph.py", line 382, in <module>
run_main()
File "freeze_graph.py", line 379, in run_main
app.run(main=my_main, argv=[sys.argv[0]] + unparsed)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "freeze_graph.py", line 378, in <lambda>
my_main = lambda unused_args: main(unused_args, flags)
File "freeze_graph.py", line 272, in main
flags.saved_model_tags, checkpoint_version)
File "freeze_graph.py", line 254, in freeze_graph
checkpoint_version=checkpoint_version)
File "freeze_graph.py", line 128, in freeze_graph_with_def_protos
var_list=var_list, write_version=checkpoint_version)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1218, in __init__
self.build()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1227, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1263, in _build
build_save=build_save, build_restore=build_restore)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 729, in _build_internal
saveables = self._ValidateAndSliceInputs(names_to_saveables)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 632, in _ValidateAndSliceInputs
variable)
TypeError: names_to_saveables must be a dict mapping string names to Tensors/Variables. Not a variable: Tensor("BoxPredictor_0/BoxEncodingPredictor/biases:0", shape=(12,), dtype=float32)
请你帮我解决这个问题,
最诚挚的问候,