小编vzZ*_*vzZ的帖子

在 PyCharm 中使用 tensorflow2.0 时出现错误“找不到参考”

当我从 tensorflow 导入包、类或方法时显示以下错误:

Cannot find reference 'keras' in '__init__.py' less... (Ctrl+F1) 
Inspection info: This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items.
Run Code Online (Sandbox Code Playgroud)

使用 tensorflow 的预览版本时不会发生此问题。但是,程序仍然可以正常运行。我在“tensorflow.keras”中发现包“keras”,在编码界面中出现此错误,但是当我更改为导入“tensorflow.python.keras”时它无法运行。我该如何解决这个问题?

我正在使用 tensorflow 2.0.0alpha 和最新版本的 Pycharm

PyCharm 2018.3.5 (Professional Edition)
Build #PY-183.5912.18, built on February 26, 2019
Licensed to xxx
Subscription is active until May 14, 2019
For …
Run Code Online (Sandbox Code Playgroud)

pycharm tensorflow2.0

7
推荐指数
1
解决办法
2907
查看次数

标签 统计

pycharm ×1

tensorflow2.0 ×1