TensorFlow 开启了多少个进程?
How many processes does TensorFlow open?
我正在使用扭矩 运行 一些使用 tensorflow
库的基于 CNN 的学习。 (每个任务 1 CPU)
当我 运行 top
在我的服务器上时,我注意到: load average: 677.29, 668.59, 470.
我创建了一个这样的会话:sess = tf.Session()
所以我的问题是文档中有某个地方我可以阅读 TensorFlow 使用的时间和数量。
当前版本的 TensorFlow (0.6.0) 在 单个进程中运行 :如果您使用C++ 接口)。
但是,TensorFlow 默认使用多线程,这可能是您看到的高平均负载的原因。默认情况下,TensorFlow 将根据适合您系统的数量为两个线程池选择线程数。当前,默认行为是为 "inter-op" threadpool (which determines the number of ops that can execute in parallel), and the "intra-op" threadpool (which determines the number of threads available for parallelizing within an op). Another source of threads is in the Python-based QueueRunner
分配与内核相同数量的线程,每个队列至少启动一个线程(通常在输入管道中)。
因此,如果您拥有大量内核,并且您的 TensorFlow 程序具有大量可用的并行性(或复杂的输入管道),您最终可能会看到如此高的平均负载。
我正在使用扭矩 运行 一些使用 tensorflow
库的基于 CNN 的学习。 (每个任务 1 CPU)
当我 运行 top
在我的服务器上时,我注意到: load average: 677.29, 668.59, 470.
我创建了一个这样的会话:sess = tf.Session()
所以我的问题是文档中有某个地方我可以阅读 TensorFlow 使用的时间和数量。
当前版本的 TensorFlow (0.6.0) 在 单个进程中运行 :如果您使用C++ 接口)。
但是,TensorFlow 默认使用多线程,这可能是您看到的高平均负载的原因。默认情况下,TensorFlow 将根据适合您系统的数量为两个线程池选择线程数。当前,默认行为是为 "inter-op" threadpool (which determines the number of ops that can execute in parallel), and the "intra-op" threadpool (which determines the number of threads available for parallelizing within an op). Another source of threads is in the Python-based QueueRunner
分配与内核相同数量的线程,每个队列至少启动一个线程(通常在输入管道中)。
因此,如果您拥有大量内核,并且您的 TensorFlow 程序具有大量可用的并行性(或复杂的输入管道),您最终可能会看到如此高的平均负载。