在Tensorflow中保存或加载图形时设置clear_devices = true的缺点

时间:2017-04-13 14:10:14

标签: tensorflow tensorflow-serving

Tensorflow中有许多方法可以使用clear_devices个设备。例如session_bundle.exporter.Exporter:initimport_meta_graphexport_meta_graph和python.training.saver.Saver.export_meta_graph`。文档声明:

 clear_devices: Whether or not to clear the device field for an `Operation`
    or `Tensor` during export.

但是不要澄清剥离这些信息的含义。

1 个答案:

答案 0 :(得分:1)

从图表中删除设备信息意味着,如果不添加新的设备放置指令,操作将被放置per defaults。如果导出/导入的图形将在不同的设置中执行,或者输入到它的数据不同(例如,在GPU上训练后在CPU上使用小批量服务),这可能很有用。