Coder Social home page Coder Social logo

wb14123 / seq2seq-couplet Goto Github PK

View Code? Open in Web Editor NEW
5.5K 126.0 1.1K 51 KB

Play couplet with seq2seq model. 用深度学习对对联。

Home Page: https://ai.binwang.me/couplet

License: GNU Affero General Public License v3.0

Python 98.25% Dockerfile 1.75%
seq2seq deep-learning machine-learning

seq2seq-couplet's Issues

Traceback [Errno 2] No such file or directory: '/data/dl-data/couplet/vocabs'

Traceback (most recent call last):
File "D:/CODE/project/tensorflow/seq2seq-couplet/couplet.py", line 13, in
restore_model=False)
File "D:\CODE\project\tensorflow\seq2seq-couplet\model.py", line 33, in init
train_target_file, vocab_file, batch_size)
File "D:\CODE\project\tensorflow\seq2seq-couplet\reader.py", line 50, in init
self.vocabs = read_vocab(vocab_file)
File "D:\CODE\project\tensorflow\seq2seq-couplet\reader.py", line 33, in read_vocab
f = open(vocab_file, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/data/dl-data/couplet/vocabs'

网站证书过期了

image

如图。如果选择忽略并打开网页话请求也会因为证书过期无法加载。

image

请问tensorflow版本是多少呀?

请问我们这工程用的tensorflow版本是多少呀?我现在用的是tensorflow 1.11.0的版本,但运行couplet.py训练模型的过程中出现如下错误:

"D:\Program Files\Anaconda3\python.exe" K:/other_proj/seq2seq-couplet-master/couplet.py
D:\Program Files\Anaconda3\lib\site-packages\h5py_init_.py:34: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
WARNING:tensorflow:From K:\other_proj\seq2seq-couplet-master\seq2seq.py:12: BasicLSTMCell.init (from tensorflow.python.ops.rnn_cell_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This class is deprecated, please use tf.nn.rnn_cell.LSTMCell, which supports all the feature this cell currently has. Please replace the existing code with tf.nn.rnn_cell.LSTMCell(name='basic_lstm_cell').
2019-01-21 10:06:30.391998: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
Reloading model file before training.
Saving model. Step: 0, loss: 0.956932


src: 龙 湾 子 携 龙 坨 女 , 龙 舟 赛 上 龙 腾 虎 跃
output: , ,
target: 马 王 爷 带 马 云 孙 , 马 街 书 会 马 壮 人 强

src:天 涯 寻 醉 客
output:
target: 海 角 觅 诗 行

src:凡 却 非 凡 , 半 坡 烟 雨 国 风 里
output: ,
target: 了 而 未 了 , 一 卷 文 心 吾 爱 中

src:分 牝 牡
output:
target: 辨 雄 雌

src:春 绿 千 村 , 碧 江 共 旗 山 一 色
output: ,
target: 政 兴 百 业 , 红 木 与 牛 仔 双 名

src:溪 头 几 串 童 年 梦
output:
target: 心 底 一 支 岁 月 歌

src:不 欲 干 鞋 沾 湿 水
output:
target: 何 妨 赤 脚 濯 清 流
Evaluate model. Step: 0, score: 0.000000, loss: 0.956932
2019-01-21 10:12:55.659938: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:56.320540: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:56.545342: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:56.794942: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:57.013343: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:57.233946: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:57.498948: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:57.717348: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:57.966949: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:58.214553: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:58.428354: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:58.678955: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:58.881755: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:59.141356: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:59.357157: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:59.591158: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:12:59.809558: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:13:00.027959: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:13:00.269563: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:13:00.524771: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:13:00.743172: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:13:00.977172: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:13:01.214173: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:13:01.448376: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:13:01.666776: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:13:01.885177: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
2019-01-21 10:13:02.119177: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at variable_ops.cc:104 : Already exists: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
Traceback (most recent call last):
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1292, in _do_call
return fn(*args)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1277, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1367, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.AlreadyExistsError: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
[[{{node gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var}} = TemporaryVariabledtype=DT_FLOAT, shape=[1024], var_name="gradients/...dd/tmp_var", _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "K:/other_proj/seq2seq-couplet-master/couplet.py", line 15, in
m.train(50000)
File "K:\other_proj\seq2seq-couplet-master\model.py", line 135, in train
self.train_target_seq_len: target_seq_len})
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 887, in run
run_metadata_ptr)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1110, in _run
feed_dict_tensor, options, run_metadata)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1286, in _do_run
run_metadata)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1308, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.AlreadyExistsError: Resource __per_step_136/gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var/struct tensorflow::TemporaryVariableOp::TmpVar
[[{{node gradients/decoder/while/BasicDecoderStep/decoder/attention_wrapper/bahdanau_attention/mul/Enter_1_grad/ArithmeticOptimizer/AddOpsRewrite_Add/tmp_var}} = TemporaryVariabledtype=DT_FLOAT, shape=[1024], var_name="gradients/...dd/tmp_var", _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

Process finished with exit code 1

高级点的 确实还不行...

上联: 包子包食饱
对的: 花生子女香

上联: 深水潭 冷冰寒
对的: 古松石 古柏枯

革命尚未成功, 小AI尚需努力~

i have no idea about the encoder_state

for layer_id in range(bi_layer_size):
encoder_state.append(bi_encoder_state[0][layer_id])
encoder_state.append(bi_encoder_state[1][layer_id])
encoder_state = tuple(encoder_state)

and i do not know why we should change the order of encoder_state? And i think the attention model just use the last output about encoder.

运行完couplet.py后运行server.py时遇到问题

2018-04-12 15:19:39.686884: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-04-12 15:19:39.763650: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at save_restore_tensor.cc:170 : Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for /Users/info_kerwin/Desktop/seq2seq/data/dl-data/models/tf-lib/output_couplet_prod/model.ckpl

couplet.py训练完后的数据是四个:model.ckpl.data-00000-of-00001、model.ckpl.index、model.ckpl.meta、checkpoint,运行server.py是如何产生model.ckpl文件的?

貌似还需努力

上联:
李云龙平安夜打平安县城
下联:
花莲喷水池水喷莲花莲湖

还需努力学习

加急

兄弟,你看看“百万坦克上广场”下一句是什么,祝好

真的好厉害!

今天偶然间知乎推送了这个项目,打开看了下真有意思。试了一下这个对联的接口,发现主页面还是nginx的欢迎界面,哈哈!


深度学习模型怎么跑在后端提供接口

有点好奇深度学习跑出来的模型,怎么运行产生后端接口来访问?是怎么的一套流程呢?老哥有空的时候方便说下?

想借你的接口用在自己的应用

我想在自己的小项目网站加上这个对对联的功能,不会有多少访问量,纯属自娱自乐。
要是兄弟你觉得不行,跟我说下我随时撤掉。
最后膜拜大佬!

对单个词语时的问题

在demo里,有几个词语都被对成了“开发区”
目前我看到的有:
好运气
运动会
大新闻

这是不是一个bug的征兆?

近期有感w

上联:
坝长千尺难防民口,墙高万丈莫拦人心
下联:
钱通万件不通法眼,量大千秋牢记公平

收敛了www

上联:
一枕松风声更幽
下联:
半窗竹影韵尤幽
下联:
一枕松风声更幽
下联:
半窗竹影韵尤幽
(无限循环)

损失函数问题

感觉这个损失函数是不是有点问题啊,tf.reduce_sum(cost) / tf.to_float(batch_size),分子是cost的和,分母怎么会是batchsize?不应该是tf.reduce_sum(loss_mask)么?

对繁体字的识别成迷

不小心贴了一句繁体字,然后发现行为很迷啊。

  1. 學士衣冠無彩色 -> 文章黼黻芳名
  2. 學士衣冠无彩色 -> 人面壁有光辉
  3. 学士衣冠無彩色 -> 先生仪表聿元辉
  4. 学士衣冠无彩色 -> 英雄肝胆有余香

tensorflow.python.framework.errors_impl.ResourceExhaustedError

Traceback (most recent call last):
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1322, in _do_call
return fn(*args)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1307, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1409, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[32,4096] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[Node: bidirectional_rnn/fw/fw/while/fw/multi_rnn_cell/cell_1/basic_lstm_cell/MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/device:GPU:0"](bidirectional_rnn/fw/fw/while/fw/multi_rnn_cell/cell_1/basic_lstm_cell/concat, bidirectional_rnn/fw/fw/while/fw/multi_rnn_cell/cell_1/basic_lstm_cell/MatMul/Enter)]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

 [[Node: decoder/while/BasicDecoderStep/decoder/attention_wrapper/assert_equal/All/_129 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_862_d..._equal/All", tensor_type=DT_BOOL, _device="/job:localhost/replica:0/task:0/device:CPU:0"](^_cloopdecoder/while/BasicDecoderStep/decoder/attention_wrapper/assert_equal/Assert/Assert/data_0/_5)]]

Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:/CODE/project/tensorflow/seq2seq-couplet/couplet.py", line 15, in
m.train(5000000)
File "D:\CODE\project\tensorflow\seq2seq-couplet\model.py", line 149, in train
self.train_target_seq_len: target_seq_len})
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 900, in run
run_metadata_ptr)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1135, in _run
feed_dict_tensor, options, run_metadata)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1316, in _do_run
run_metadata)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1335, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[32,4096] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[Node: bidirectional_rnn/fw/fw/while/fw/multi_rnn_cell/cell_1/basic_lstm_cell/MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/device:GPU:0"](bidirectional_rnn/fw/fw/while/fw/multi_rnn_cell/cell_1/basic_lstm_cell/concat, bidirectional_rnn/fw/fw/while/fw/multi_rnn_cell/cell_1/basic_lstm_cell/MatMul/Enter)]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

 [[Node: decoder/while/BasicDecoderStep/decoder/attention_wrapper/assert_equal/All/_129 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_862_d..._equal/All", tensor_type=DT_BOOL, _device="/job:localhost/replica:0/task:0/device:CPU:0"](^_cloopdecoder/while/BasicDecoderStep/decoder/attention_wrapper/assert_equal/Assert/Assert/data_0/_5)]]

Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

Caused by op 'bidirectional_rnn/fw/fw/while/fw/multi_rnn_cell/cell_1/basic_lstm_cell/MatMul', defined at:
File "D:/CODE/project/tensorflow/seq2seq-couplet/couplet.py", line 13, in
restore_model=False)
File "D:\CODE\project\tensorflow\seq2seq-couplet\model.py", line 45, in init
self._init_train()
File "D:\CODE\project\tensorflow\seq2seq-couplet\model.py", line 72, in _init_train
self.num_units, self.layers, self.dropout)
File "D:\CODE\project\tensorflow\seq2seq-couplet\seq2seq.py", line 129, in seq2seq
num_units, layers, input_keep_prob)
File "D:\CODE\project\tensorflow\seq2seq-couplet\seq2seq.py", line 26, in bi_encoder
time_major = False)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\rnn.py", line 403, in bidirectional_dynamic_rnn
time_major=time_major, scope=fw_scope)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\rnn.py", line 618, in dynamic_rnn
dtype=dtype)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\rnn.py", line 815, in _dynamic_rnn_loop
swap_memory=swap_memory)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3209, in while_loop
result = loop_context.BuildLoop(cond, body, loop_vars, shape_invariants)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 2941, in BuildLoop
pred, body, original_loop_vars, loop_vars, shape_invariants)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 2878, in _BuildLoop
body_result = body(*packed_vars_for_body)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3179, in
body = lambda i, lv: (i + 1, orig_body(*lv))
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\rnn.py", line 784, in _time_step
skip_conditionals=True)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\rnn.py", line 239, in _rnn_step
new_output, new_state = call_cell()
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\rnn.py", line 772, in
call_cell = lambda: cell(input_t, state)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\rnn_cell_impl.py", line 232, in call
return super(RNNCell, self).call(inputs, state)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\layers\base.py", line 329, in call
outputs = super(Layer, self).call(inputs, *args, **kwargs)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 703, in call
outputs = self.call(inputs, *args, **kwargs)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\rnn_cell_impl.py", line 1325, in call
cur_inp, new_state = cell(cur_inp, cur_state)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\rnn_cell_impl.py", line 1126, in call
output, new_state = self._cell(inputs, state, scope=scope)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\rnn_cell_impl.py", line 339, in call
*args, **kwargs)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\layers\base.py", line 329, in call
outputs = super(Layer, self).call(inputs, *args, **kwargs)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 703, in call
outputs = self.call(inputs, *args, **kwargs)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\rnn_cell_impl.py", line 638, in call
array_ops.concat([inputs, h], 1), self._kernel)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\math_ops.py", line 2014, in matmul
a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_math_ops.py", line 4567, in mat_mul
name=name)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 3414, in create_op
op_def=op_def)
File "C:\Users\47263\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1740, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[32,4096] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[Node: bidirectional_rnn/fw/fw/while/fw/multi_rnn_cell/cell_1/basic_lstm_cell/MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/device:GPU:0"](bidirectional_rnn/fw/fw/while/fw/multi_rnn_cell/cell_1/basic_lstm_cell/concat, bidirectional_rnn/fw/fw/while/fw/multi_rnn_cell/cell_1/basic_lstm_cell/MatMul/Enter)]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

 [[Node: decoder/while/BasicDecoderStep/decoder/attention_wrapper/assert_equal/All/_129 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_862_d..._equal/All", tensor_type=DT_BOOL, _device="/job:localhost/replica:0/task:0/device:CPU:0"](^_cloopdecoder/while/BasicDecoderStep/decoder/attention_wrapper/assert_equal/Assert/Assert/data_0/_5)]]

Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

跑到660900之后,报NaN错误

2019-08-06 00:52:38.476421: E tensorflow/core/kernels/check_numerics_op.cc:185] abnormal_detected_host @0x7fb3e960d900 = {0, 1} Found Inf or
NaN global norm.Traceback (most recent call last):
File "/root/anaconda3/envs/fjpy36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call
return fn(*args)
File "/root/anaconda3/envs/fjpy36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1319, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/root/anaconda3/envs/fjpy36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Found Inf or NaN global norm. : Tensor had Inf values
[[{{node VerifyFinite/CheckNumerics}} = CheckNumericsT=DT_FLOAT, message="Found Inf or NaN global norm.", _device="/job:localhost/r
eplica:0/task:0/device:GPU:0"
]] [[{{node clip_by_global_norm/mul_1/_301}} = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0
", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_2818_clip_by_global_norm/mul_1", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"
]]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.