当我尝试导入 tflearn 时出现错误:无法从“tensorflow.python.util.nest”导入名称“is_sequence”

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

我已经安装了

tflearn
,当我尝试导入它时出现以下错误:

ImportError: cannot import name 'is_sequence' from 'tensorflow.python.util.nest' (C:\Users\fsafi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tensorflow\python\util\nest.py)

我尝试了以下方法:

import tflearn
tensorflow machine-learning import jupyter-notebook tflearn
1个回答
0
投票

我在设置新的 tf 环境时遇到了完全相同的问题。我相信这是因为 tflearn==0.5.0 太旧了,无法与最新的tensorflow=2.13.0一起使用。

我必须将张量流回退到旧版本,例如 2.12.0 才能使其正常工作。

tflearn 上也有一个 PR 可以解决此问题,但仍在进行中: https://github.com/tflearn/tflearn/pull/1173/commits

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