没有属性 'contrib' 的问题()

no attribute 'contrib' for problems()

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

>>> 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

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

pip3 install tensorflow==1.15.0