2024-09-30 16:34:18 发布
网友
https://github.com/Currie32/Spell-Checker
在上面的链接代码中,我得到一个错误:DynamicAttentionWrapper没有定义。我使用的是TensorFlow版本1.2。我不能克服这个错误。请帮帮我
您的tensorflow版本中的DynamicAttentionWrapper有问题
tensorflow
DynamicAttentionWrapper
尝试将DynamicAttentionWrapper更改为AttentionWrapper或降级为tensorflow 1.1
AttentionWrapper
tensorflow 1.1
对于您的tensorflow版本,请尝试对initial_state, inference_logits and training_logits进行以下更改:
initial_state, inference_logits and training_logits
initial_state = dec_cell.zero_state(batch_size=batch_size,dtype=tf.float32).clone(cell_state=enc_state) inference_logits, _ ,_ = tf.contrib.seq2seq.dynamic_decode(inference_decoder, output_time_major=False, impute_finished=True, maximum_iterations=max_target_length) training_logits, _ ,_ = tf.contrib.seq2seq.dynamic_decode(training_decoder, output_time_major=False, impute_finished=True, maximum_iterations=max_target_length)
您的
tensorflow
版本中的DynamicAttentionWrapper
有问题尝试将
DynamicAttentionWrapper
更改为AttentionWrapper
或降级为tensorflow 1.1
对于您的
tensorflow
版本,请尝试对initial_state, inference_logits and training_logits
进行以下更改:相关问题 更多 >
编程相关推荐