Difference between ClientSession and Session in TensorFlow C++ API

前端 未结 1 1659
慢半拍i
慢半拍i 2021-02-08 12:52

TensorFlow r1.0 C++ API comes with Session and ClientSession classes. Some of the examples shipping with TensorFlow use ClientSession and

1条回答
  •  梦谈多话
    2021-02-08 13:14

    In TensorFlow's C++ API, the tensorflow::Session API is a low-level interface that deals with serialized GraphDef protocol buffers and provides a string-based interface for running subgraphs.

    By contrast, the tensorflow::ClientSession API is higher level, and integrates with the new C++ API for building TensorFlow graphs—much in the same way as the Python tf.Graph and tf.Session classes do.

    Therefore, you will probably want to use a tensorflow::ClientSession if you are building the graph with the C++ API, but the tensorflow::Session interface is easier to use if you already have a serialized GraphDef (representing e.g. a pre-trained model) and just want to run inference on that model.

    0 讨论(0)
提交回复
热议问题