我用Python写了一些TensorFlow代码。它可以编译并运行良好。但是,某些名称无法由 IntelliJ 解析。
将鼠标悬停在这样一个未找到的引用上时显示的错误是Cannot find reference '...' in 'tensorflow._api.v1.data'
;展开的消息以 Inspection info: This inspection detects names that should resolve but don't.
开头。
这种未解析引用的一个示例是 tf.data.Dataset
。当我导航到tf.data
时,那里只有一个__init__.py
模块,以# This file is MACHINE GENERATED!
开头。
有很多这样的软件包,它们在 External Libraries
.解决此问题的正确方法是什么?
我在tf.contrib部分遇到了类似的问题。我用Anaconda安装了TensorFlow版本1.10.0。它使用 conda 包管理器。安装 TF 的步骤
conda install tensorflow==1.10.0
使用 Conda 安装解决了我的问题。