非正常状态:GpuLaunchKernel(..) 状态:内部:tensorflow 内存不足 [英] Non-OK-status: GpuLaunchKernel(..) status: Internal: out of memory in tensorflow

查看:255
本文介绍了非正常状态:GpuLaunchKernel(..) 状态:内部:tensorflow 内存不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含基类的模块

I have a module which contains base-class

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

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

I'm importing the base class in another module

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")
        ....

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

When the above module is complied, it raises an error

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 处停止两次.随后它在相当长的时间流逝后抛出错误.

I ran the code using vscode in debug mode and found that pointer-to-breakpoint stops twice at self.add_weight. Following which it throws error after considerable time lapse.

推荐答案

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

I was trying to reproduce the same error with Sublime Text, so I switched to it. Surprisingly, the code started working as intended.

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

However, I wonder why this might be happening?

这篇关于非正常状态:GpuLaunchKernel(..) 状态:内部:tensorflow 内存不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆