要将训练有素的网络导入C++,您需要导出网络才能执行此操作.经过大量搜索并几乎找不到有关它的信息后,我们明白应该使用freeze_graph()来做到这一点.
感谢Tensorflow的新0.7版本,他们添加了它的文档.
在查看文档之后,我发现几乎没有类似的方法,你能说出freeze_graph()
和之间有什么区别:
tf.train.export_meta_graph
因为它有类似的参数,但它似乎也可以用于将模型导入C++(我只是猜测区别是对于使用此方法输出的文件,您只能使用import_graph_def()
或其他东西?)
还包括如何使用一个问题write_graph()
:在相关文件中体现graph_def
由下式给出sess.graph_def
,但例子freeze_graph()
是sess.graph.as_graph_def()
.这两者有什么区别?
这个问题与这个问题有关.
谢谢!
我通过获取想法阅读一批图像这里从tfrecords(通过转换此)
我的图像是cifar图像,[32,32,3],你可以看到,在阅读和传递图像时,形状是正常的(batch_size=100
)
据我所知,日志中陈述的两个最值得注意的问题是
Compute status: Out of range: RandomSuffleQueue '_2_input/shuffle_batch/random_shuffle_queue' is closed and has insufficient elements (requested 100, current size 0)
我怎么解决这个问题?
日志:
1- image shape is TensorShape([Dimension(3072)])
1.1- images batch shape is TensorShape([Dimension(100), Dimension(3072)])
2- images shape is TensorShape([Dimension(100), Dimension(3072)])
W tensorflow/core/kernels/queue_ops.cc:79] Invalid argument: Shape mismatch in tuple component 0. Expected [3072], got [12288]
W tensorflow/core/common_runtime/executor.cc:1027] 0x7fa72abc89a0 Compute status: Invalid argument: Shape mismatch in tuple component 0. Expected [3072], got [12288] …
Run Code Online (Sandbox Code Playgroud)