代码之家  ›  专栏  ›  技术社区  ›  ntlarry

Google Colab:您连接到GPU运行时,但不使用GPU

  •  0
  • ntlarry  · 技术社区  · 5 年前

    关于这个话题以前有很多问题,但没有一个答案符合我的具体问题。

    我试图在Google Colab上使用Keras 2.2.5来训练Mask RCNN。我收到一条消息,说“您已连接到GPU运行时,但未使用GPU”。我会在堆栈溢出上查找类似的问题:

    Why isn't my colab notebook using the GPU?

    Anyone experienced the warning about Google colaboratory:You are connected to a GPU runtime, but not utilizing the GPU

    但他们都只说要使用使用GPU的软件包,比如Tensorflow。然而,我使用的是Keras 2.2.5(可能是Tensorflow 1.14后端,因为我必须为Keras 2.2.5安装Tensorflow 1.14),它与GPU兼容。这是为什么?

    更多信息:

    • 谷歌可乐
    • Python 3.6
    • 我使用Keras 2.2.5(Tensorflow 1.14)而不是Keras 2.4.3,因为我使用的是2017年的一些代码,这些代码只适用于Tensorflow 1。因此,不可能使用Tensorflow 2。
    • 我以前用过谷歌Colab来训练GAN,但这个错误从未出现过。然而,我在这种情况下使用了Tensorflow 2。
    • 我从来没有需要添加任何代码来指定GPU应该运行,我不知道我是否应该在这里这样做。
    • 我不得不下载Keras 2.2.5和Tensorflow 1.14来替换现有版本(Keras 2.4.3和Tensorflow 2.2),我不清楚这是否与此有关
    0 回复  |  直到 5 年前