【发布时间】:2019-04-29 11:30:46
【问题描述】:
将 Elmo 嵌入应用到我的数据时出现错误。我有 7255 个句子。
embeddings = embed(
sentences,
signature="default",
as_dict=True)['default']
#Start a session and run ELMo to return the embeddings in variable x
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
sess.run(tf.tables_initializer())
x = sess.run(embeddings)
错误是:
ResourceExhaustedError: OOM 分配具有 shape[36021075,50] 的张量并通过分配器 cpu 在 /job:localhost/replica:0/task:0/device:CPU:0 上键入 int32 [[node module_apply_default/map/TensorArrayStack/TensorArrayGatherV3(定义在 C:\Users...\envs\tf_36\lib\site-packages\tensorflow_hub\native_module.py:547)]] 提示:如果您想在 OOM 发生时查看已分配张量的列表,请将 report_tensor_allocations_upon_oom 添加到 RunOptions 以获取当前分配信息。
【问题讨论】: