我正在使用Nvidia Digits Box与GPU(Nvidia GeForce GTX Titan X)和Tensorflow 0.6来训练神经网络,并且一切正常。但是,当我使用nvidia-smi -l 1
检查Volatile GPU Util
时,我注意到它只有6%,我认为大部分计算都在CPU上,因为我注意到运行Tensorflow的进程占用了大约90%的CPU使用量。结果是培训过程非常缓慢。我想知道是否有办法充分利用GPU而不是CPU来加速培训过程。谢谢!Tensorflow 0.6 GPU Issue
0
A
回答
3
我怀疑你的某处存在瓶颈(就像这个github issue) - 你有一些没有GPU实现的操作,所以它被放在CPU上,并且GPU由于数据传输而空闲。例如,直到最近reduce_mean
没有在GPU上实现,并且在此之前Rank
没有在GPU上实现,并且它被许多操作符隐式地使用。
有一次,我看到一个网络从fully_connected_preloaded.py缓慢,因为有一个Rank
操作系统放在CPU上,因此在每一步都会触发从GPU到CPU的整个数据集的传输。
为了解决这个问题,我首先建议升级到0.8,因为它有更多的GPU用于整数输入(reduce_prod
用于整数输入,reduce_mean
等)。
然后,您可以使用log_device_placement=True
创建您的会话,并查看是否有任何操作放在CPU或GPU上,导致每步的传输过多。
经常有在不具备GPU实现输入管道(如parse_example
)OPS,我发现它的帮助有时使用with tf.device("/cpu:0"):
块
相关问题
- 1. Tensorflow contrib.learn.Estimator multi-GPU
- 2. TensorFlow Data Starved GPU
- 3. Tensorflow不使用GPU
- 4. TensorFlow GPU,CUDA_ERROR_LAUNCH_FAILED on tf.one_hot()
- 5. tensorflow多GPU训练
- 6. Tensorflow:在GPU和CPU
- 7. GPU上的Tensorflow OOM
- 8. Tensorflow-GPU错误 - Pycharm
- 9. Tensorflow GPU OOM错误
- 10. GPU + CPU Tensorflow训练
- 11. Tensorflow GPU /多GPU如何分配内存?
- 12. TensorFlow从多个GPU选择GPU使用
- 13. 防止TensorFlow访问GPU?
- 14. TensorFlow GPU时代优化?
- 15. TensorFlow-Slim多GPU训练
- 16. GPU tensorflow运行问题
- 17. TensorFlow:多GPU配置(性能)
- 18. GPU tensorflow安装问题
- 19. Tensorflow-GPU无法导入
- 20. tensorflow的Mac OS GPU支持
- 21. Tensorflow多GPU性能不好
- 22. ram not tensorflow检测gpu
- 23. tensorflow-gpu通过pip超时
- 24. TensorFlow只适用于GPU 0
- 25. TensorFlow GPU CUDA CUDDN错误
- 26. TensorFlow似乎不使用GPU
- 27. TensorFlow GPU支持Mac - OpenCL的
- 28. Tensorflow不想使用GPU
- 29. Tensorflow与GPU和CUDA v5.5
- 30. tensorflow多GPU共享变量
感谢你的伟大的答案引脚整个输入管道CPU!在完成一些分析工作后,我注意到'tensor.eval(session = ...,feed_dict = ...)'花费的时间太长,并且随着代码运行时间的增加,时间消耗也会增加。 (顺便说一下,我使用的是Tensorflow 0.6,我试图将它升级到0.8,但是我遇到了问题 - 我想这可能是Tensorflow 0.8的bug: http://stackoverflow.com/questions/36877559/tensorflow-0-8-import-and-export-output-tensors-problems。我还想知道如果我仍然继续使用,我是否可以改进'tensor.eval()'的使用0.6) –