You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Removing the graph/session in master process will solve the problem. So it seems like once there is a session, we cannot use fork?
The problem exists with and without GPU.
NOTE: this code doesn't terminate normally. You'll probably need to manually kill the forked processes after the master exited.
The in-process session (i.e. tf.Session() with no arguments) is not designed to be fork()-safe. If you want to share a set of devices between multiple processes, create a tf.train.Server in one process, and create sessions that connect to that server (with tf.Session("grpc://...")) in the other processes.
Here target refers to the execution engine to connect to. That is, one has to run the working session in another process, in distributed mode, and tf.Session with arguments is still not fork()-safe.
Activity
[-]Wierd Behavior after Fork[/-][+]Weird Behavior after Fork[/+][-]Weird Behavior after Fork[/-][+]Session got stuck after fork[/+]mrry commentedon May 21, 2016
The in-process session (i.e.
tf.Session()with no arguments) is not designed to befork()-safe. If you want to share a set of devices between multiple processes, create atf.train.Serverin one process, and create sessions that connect to that server (withtf.Session("grpc://...")) in the other processes.mavenlin commentedon Oct 20, 2016
@mrry Does it mean there is a way to create
forksafetf.Sessionwithtf.Session(args)?Liam0205 commentedon Oct 20, 2016
@mavenlin
The prototype of
tf.SessionisHere
targetrefers to the execution engine to connect to. That is, one has to run the working session in another process, in distributed mode, andtf.Sessionwith arguments is still notfork()-safe.Sad news.