我正在尝试使用 TFLearn ( https://github.com/tflearn/tflearn ) 的前沿版本,这是一个深度学习库。但是在将 tflearn 导入 python 文件时,我遇到了一个属性错误,给出了它的堆栈跟踪。如果有人成功安装了相同版本,请提出解决方案。

  import tflearn
  File "/usr/local/lib/python2.7/dist-packages/tflearn/__init__.py", line 9, in <module>
    from . import models
  File "/usr/local/lib/python2.7/dist-packages/tflearn/models/__init__.py", line 2, in <module>
    from .dnn import DNN
  File "/usr/local/lib/python2.7/dist-packages/tflearn/models/dnn.py", line 5, in <module>
    from ..helpers.trainer import Trainer
  File "/usr/local/lib/python2.7/dist-packages/tflearn/helpers/__init__.py", line 2, in <module>
    from .evaluator import Evaluator
  File "/usr/local/lib/python2.7/dist-packages/tflearn/helpers/evaluator.py", line 6, in <module>
    from ..utils import to_list
  File "/usr/local/lib/python2.7/dist-packages/tflearn/utils.py", line 16, in <module>
    import tflearn.variables as vs
  File "/usr/local/lib/python2.7/dist-packages/tflearn/variables.py", line 8, in <module>
    @tf.contrib.framework.add_arg_scope
AttributeError: 'module' object has no attribute 'add_arg_scope'

最佳答案

您使用的是哪个版本的 TensorFlow?可能太旧了。尝试将您的 TensorFlow 版本更新到 0.8 或 0.9,这应该可以解决该问题。

关于python - 属性错误 : 'module' object has no attribute 'add_arg_scope' ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38424041/

10-12 19:34