【发布时间】:2018-07-09 11:28:30
【问题描述】:
我正在使用此代码来训练新闻文章数据集。
https://github.com/borislavmavrin/stance-detection/blob/master/model_matchingLSTM_wdev.py
当我加载 GoogleNews word2vec 文件时,它给了我错误。
ValueError: 无法创建内容大于 2GB 的张量原型。
stacktrace 从https://github.com/borislavmavrin/stance-detection/blob/master/model_matchingLSTM_wdev.py#L614 行开始,
然后转到https://github.com/borislavmavrin/stance-detection/blob/master/model_matchingLSTM_wdev.py#L154
我们将不胜感激。我现在不想改变这段代码的结构,我现在只是更关注结果,因为这只是我想在这个数据集上做的一个原型。如果结果足够好,我可能会编写自己的模型或改进现有模型。
【问题讨论】:
-
您使用的是 GPU 吗?你的内存有多大?一种选择可能是使用
with tf.device("cpu:0"):子句嵌套初始化词嵌入的部分。
标签: python tensorflow machine-learning nlp word2vec