tflearn with tensorflow 2.0

问题描述 投票:0回答:1

我无法使用TensorFlow 2.0导入tflearn

Python 3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license()" for more information.
>>> import tflearn
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tflearn/helpers/summarizer.py", line 9, in <module>
    merge_summary = tf.summary.merge
AttributeError: module 'tensorboard.summary._tf.summary' has no attribute 'merge'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import tflearn
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tflearn/__init__.py", line 8, in <module>
    from . import models
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tflearn/models/__init__.py", line 2, in <module>
    from .dnn import DNN
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tflearn/models/dnn.py", line 6, in <module>
    from ..helpers.trainer import Trainer
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tflearn/helpers/__init__.py", line 2, in <module>
    from .evaluator import Evaluator
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tflearn/helpers/evaluator.py", line 9, in <module>
    from .trainer import evaluate_flow
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tflearn/helpers/trainer.py", line 20, in <module>
    from .summarizer import summaries, summarize, summarize_gradients, \
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tflearn/helpers/summarizer.py", line 12, in <module>
    merge_summary = tf.merge_summary
AttributeError: module 'tensorflow' has no attribute 'merge_summary'

有人可以帮我吗?我真的需要尽快解决它。我对tensorflow非常陌生。

python python-3.x tensorflow tflearn
1个回答
0
投票

截至今天,tflearn(v0.3.2)尚未准备好TensorFlow 2.0,并且特别需要TF1.x。我确定它会在某个时候更新,但是现在,如果您需要tflearn,请使用TF 1。


我得到一个不同的错误:tflearn,因为ModuleNotFoundError: No module named 'tensorflow.contrib'已移至contrib,并且tensorflow_addons

© www.soinside.com 2019 - 2024. All rights reserved.