(The goal is to solve your actual problem)
In another topic, someone told you that Python has a global interpreter lock (GIL), and therefore there will be no speed advantages from multi-core processors if you have not used multiple processes.
This probably caused your desire to use multiprocessing .
However, with TF, Python is usually used only for plotting. Actual execution takes place in native code (or GPU), where the GIL does not play any role.
In light of this, I recommend just letting TF use multithreading. This can be controlled using the intra_op_parallelism_threads argument, for example:
with tf.Session(graph=graph, config=tf.ConfigProto(allow_soft_placement=True, intra_op_parallelism_threads=20)) as sess:
(Note: if you have, say, a 2-processor 32-core system, intra_op_parallelism_threads=16 may be the best argument, depending on many factors)
Maxb source share