Tensorflow: Passing a session to a python multiprocess

前端 未结 2 1925
谎友^
谎友^ 2020-12-31 15:43

I\'m using tensorflow to preprocess some large images. I was having a problem where the memory was rapidly collapsing. I turned to use multiprocessing in python so the memor

相关标签:
2条回答
  • 2020-12-31 15:52

    I don't think you can share "state" as in the tf.Session() between processes like that. I would think that each process needed it's own session.

    0 讨论(0)
  • 2020-12-31 16:00

    All you need is distributed tensorflow.

    1. Create the graph and session in the parent process. Place some of the operators(especially, variables) to workers while constructing graph.
    2. Create child processes, and run them
    0 讨论(0)
提交回复
热议问题