简体   繁体   English

将Keras(Tensorflow后端)与移动GPU(笔记本电脑)结合使用

[英]Use Keras (Tensorflow backend) with mobile GPU (laptop)

If I only use the Tensorflow code, the GPU usage rate is more than 80% and temperature rises very much. 如果仅使用Tensorflow代码,则GPU利用率超过80%,并且温度会大大升高。 But if I use Kers, the usage rate drops to 15%. 但是,如果我使用Kers,使用率会下降到15%。 Also, using Keras does not reach the maximum clock of the GPU. 另外,使用Keras不能达到GPU的最大时钟。

I tried with 980m, 1070 (laptop) and 960m, but the same result was obtained. 我尝试使用980m,1070(笔记本电脑)和960m,但获得了相同的结果。 ANN and CNN all have the same result. ANN和CNN的结果相同。

Why is my GPU utilisation so low when using Kers on a mobile (laptop) GPU? 在移动(笔记本)GPU上使用Kers时,为什么我的GPU利用率如此之低? What can I do to ensure I am getting maximum performance when using Keras on a laptop? 在笔记本电脑上使用Keras时,我该怎么做才能确保获得最佳性能?

Maybe upgrade to Tensorflow 1.3. 也许升级到Tensorflow 1.3。 In TF 1.3 Keras is already included and there is no need to additionaly install keras. 在TF 1.3中已经包括Keras,并且不需要额外安装keras。

In order to use the keras version included in TF do the following: Use for example 为了使用TF中包含的keras版本,请执行以下操作:例如

from tensorflow.contrib.keras.python.keras.models import Model

or 要么

from tensorflow.contrib.keras.python.keras.layers import Input, Conv2D, Dropout

instead of 代替

from keras.models import Model
from keras.layers import Input, Conv2D, Dropout

Maybe that solves the problem! 也许可以解决问题!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM