Traceback (most recent call last):
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/bin/freeze_graph", line 11, in <module>
sys.exit(run_main())
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/local/lib/python2.7/site-packages/tensorflow/python/tools/freeze_graph.py", line 408, in run_main
app.run(main=my_main, argv=[sys.argv[0]] + unparsed)
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/local/lib/python2.7/site-packages/tensorflow/python/tools/freeze_graph.py", line 407, in <lambda>
my_main = lambda unused_args: main(unused_args, flags)
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/local/lib/python2.7/site-packages/tensorflow/python/tools/freeze_graph.py", line 301, in main
flags.saved_model_tags, checkpoint_version)
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/local/lib/python2.7/site-packages/tensorflow/python/tools/freeze_graph.py", line 283, in freeze_graph
checkpoint_version=checkpoint_version)
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/local/lib/python2.7/site-packages/tensorflow/python/tools/freeze_graph.py", line 145, in freeze_graph_with_def_protos
var_list=var_list, write_version=checkpoint_version)
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1078, in __init__
self.build()
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1090, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1127, in _build
build_save=build_save, build_restore=build_restore)
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 765, in _build_internal
saveables = self._ValidateAndSliceInputs(names_to_saveables)
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 672, in _ValidateAndSliceInputs
for converted_saveable_object in self.SaveableObjectsForOp(op, name):
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 646, in SaveableObjectsForOp
variable, "", name)
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 128, in __init__
self.handle_op = var.op.inputs[0]
File "/media/goodvirus/34e9f1a6-6a30-4087-b582-b02e43a9aa82/DeepLearning/Entwicklungen/venv/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2106, in __getitem__
return self._inputs[i]
IndexError: list index out of range
我使用以下命令启动freeze_graph:
freeze_graph --input_graph=graph.pbtxt --input_checkpoint=model.ckpt-6300 --output_graph=frozen_graph.pb --output_node_name="softmax"
我在gpu支持下运行以下tensorflow版本:1.11.0-dev20180808
我也尝试了带有或不带有gpu支持的其他版本,但始终获得相同的结果。
云有人给我一些指示。
最好的问候,
保罗
答案 0 :(得分:1)
为社区的利益在“答案”部分中提供解决方案。
冻结用于图像分类的Resnet模型图的正确命令如下所示:
freeze_graph --input_graph=graph.pbtxt --input_checkpoint=model.ckpt-6300 --output_graph=frozen_graph.pb --output_node_name="softmax_tensor"