NELSONZHAO / zhihu

This repo contains the source code in my personal column (https://zhuanlan.zhihu.com/zhaoyeyu), implemented using Python 3.6. Including Natural Language Processing and Computer Vision projects, such as text generation, machine translation, deep convolution GAN and other actual combat code.
https://zhuanlan.zhihu.com/zhaoyeyu
3.5k stars 2.14k forks source link

mt_attention_birnn运行plot_attention函数报错 #26

Open ABadCandy opened 6 years ago

ABadCandy commented 6 years ago

报错位置:---> r = f([X.reshape(-1,20), s0, c0, out0]) InvalidArgumentError: You must feed a value for placeholder tensor 'input_1' with dtype float and shape [?,20] [[Node: input_1 = Placeholder[dtype=DT_FLOAT, shape=[?,20], _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]] [[Node: attention_weights_23/truediv/_2409 = _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_6010_attention_weights_23/truediv", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]

我的Keras版本是2.2.2,tensorflow版本是1.9,请问是什么问题呢,谢谢!