【问题标题】:no attribute 'contrib' for problems()问题()没有属性“贡献”
【发布时间】:2019-09-18 22:06:45
【问题描述】:

我正在尝试查看可用的问题(),但它给出了错误。 如果我遗漏了什么,请告诉我

>>> from tensor2tensor import problems
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\\Anaconda3\lib\site-packages\tensor2tensor\problems.py", line 22, in <module>
    from tensor2tensor.utils import registry
  File "C:\Users\\Anaconda3\lib\site-packages\tensor2tensor\utils\registry.py", line 551, in <module>
    attacks = tf.contrib.framework.deprecated(None, "Use registry.attack")(attack)
AttributeError: module 'tensorflow' has no attribute 'contrib'
>>> tf.__version__
'2.0.0-beta1'
>>>

我在 Windows 上工作

【问题讨论】:

    标签: python tensorflow nlp tensor2tensor


    【解决方案1】:

    Tensor2Tensor 库 is not yet compatible with Tensorflow 2.0,因为它仍然使用大量已弃用的 API。您目前唯一的选择是降级到旧版本,例如 Tensorflow 1.15。

    pip3 install tensorflow==1.15.0
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-09-29
      • 2013-05-16
      • 2018-07-28
      • 2013-10-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多