qhduan / just_another_seq2seq

Just another seq2seq repo
329 stars 97 forks source link

运行 python3 extract_tmx.py 内存不够 #5

Open Kiteflyingee opened 6 years ago

Kiteflyingee commented 6 years ago

大神你好,我16G内存,跑满了,最后写入文件的时候报 memoryerror,第一次用ElementTree,想只取一部分tu标签,如何实现,我看了api只有findall方法。或者有什么缩小内存占用的办法呢?

qhduan commented 6 years ago

你可以改一下,例如第36行那里

    if en and zh:
        x_data.append(en)
        y_data.append(zh)

限制x_data的大小,大于某个数字就停止了,先尝试训练小数据集