tensorflow 1.3.0 AttributeError:模块“tensorflow”没有属性“function”

2024-04-23 14:13:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是tensorflow 1.3.0(我使用的是一些论文的代码,他们说依赖性是tf 1.3.0),当我运行代码时,我得到:

~/.local/lib/python3.6/site-packages/sonnet/src/base.py in <module>()
     35 
     36 T = TypeVar("T")
---> 37 TFFunctionType = type(tf.function(lambda: None, autograph=False))  # pylint: disable=invalid-name
     38 APPLY_NAME_SCOPE = "__snt_with_name_scope"
     39 ALLOW_EMPTY_RESULT = "__snt_allow_empty_result"

AttributeError: module 'tensorflow' has no attribute 'function'

Tags: 代码namesrcbaselibpackageslocaltf