【问题标题】:Non-OK-status: GpuLaunchKernel(..) status: Internal: out of memory in tensorflow非 OK 状态:GpuLaunchKernel(..) 状态:内部:张量流内存不足
【发布时间】:2021-06-20 09:31:21
【问题描述】:

我有一个包含基类的模块

class MessagePassing(tf.keras.layers.Layer):
    def __init__():
        super(MessagePassing, self).__init__()
        ....
    def call():
        ....

我在另一个模块中导入基类

from module1 import MessgagePassing

class layer(MessagePassing):
    def __init__(self, in, out):
        super(layer, self).__init__()
        self.W = self.add_weight("w", shape=[in, out], initializer="glorot_uniform")
        ....

当上面的模块被编译时,它会引发一个错误

2021-06-20 14:42:23.392722: F ./tensorflow/core/kernels/random_op_gpu.h:232] 
Non-OK-status: GpuLaunchKernel(FillPhiloxRandomKernelLaunch<Distribution>, num_blocks, block_size, 0, d.stream(), gen, data, size, dist) 
status: Internal: out of memory   

我在调试模式下使用 vscode 运行代码,发现指向断点的指针在 self.add_weight 处停止了两次。之后它会在相当长的一段时间后引发错误。

【问题讨论】:

    标签: python tensorflow2.0


    【解决方案1】:

    我试图用 Sublime Text 重现同样的错误,所以我改用它。令人惊讶的是,代码开始按预期工作。

    但是,我想知道为什么会发生这种情况?

    【讨论】:

      猜你喜欢
      • 2020-11-25
      • 1970-01-01
      • 2016-10-10
      • 2022-10-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多