【发布时间】:2019-02-24 01:32:44
【问题描述】:
我在训练我的tensorflow模型时遇到了OOM错误,结构如下:
tf.contrib.layers.embed_sequence 使用 GoogleNewsVector 初始化 2 * tf.nn.rnn_cell.DropoutWrapper(tf.nn.rnn_cell.LSTMCell) #forward 2 * tf.nn.rnn_cell.DropoutWrapper(tf.nn.rnn_cell.LSTMCell) #backward tf.nn.bidirectional_dynamic_rnn 包裹上述层 tf.layers.dense 作为输出层
我尝试将批量大小减少到低至 64,我的输入数据填充到 1500,我的词汇大小是 8938
我使用的集群非常强大 (https://wiki.calculquebec.ca/w/Helios/en) 我正在使用两个节点,每个节点有 8 个 GPU,但仍然出现此错误:
2019-02-23 02:55:16.366766:W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES 在 reverse_op.cc:270 失败:资源耗尽:OOM 时 使用 shape[2000,800,300] 分配张量并输入 float on /job:localhost/replica:0/task:0/device:GPU:1 分配器 GPU_1_bfc
我正在使用带有 MirroredStrategy 的估算器 API,但仍然没有用,有没有办法让 tensorflow 只使用 GPU 运行训练并将张量存储在主机内存上?欢迎任何其他建议。
【问题讨论】:
标签: tensorflow machine-learning