[英]AttributeError: module 'tensorflow' has no attribute 'GraphDef'
[英]tensorflow 1.3.0 AttributeError: module 'tensorflow' has no attribute 'function'
我正在使用 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'
使用 google colab 如果它在那里工作,請嘗試以下操作:
pip uninstall tensorflow
pip install --upgrade -r tensorflow_federated/requirements.txt
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.