简体   繁体   English

AttributeError:“ HParams”对象没有属性“ get”

[英]AttributeError: 'HParams' object has no attribute 'get'

When we use tensor2tensor decoding, we have encountered this problem. 当使用tensor2tensor解码时,我们遇到了这个问题。

t2t-decoder \
  --data_dir=train_data_enzh \
  --problem=translate_enzh_wmt32k \
  --model=transformer \
  --hparams_set=transformer_base \
  --output_dir=enzhdata/model \
  --decode_hparams="beam_size=4,alpha=0.6" \
  --decode_from_file=decode_this.txt \
  --decode_to_file=translation.en

the error is: AttributeError: 'HParams' object has no attribute 'get' 错误是: AttributeError:'HParams'对象没有属性'get'

The problem is likely that you are using an old version of TensorFlow. 该问题可能是您使用的是TensorFlow的旧版本。 Upgrade and you should see the problem disappear. 升级,您应该看到问题消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM