【问题标题】:Module 'tensorflow' has no '__version__' member pylint (no-member)模块 'tensorflow' 没有 '__version__' 成员 pylint(无成员)
【发布时间】:2020-04-14 20:53:47
【问题描述】:

我刚刚安装了 Tensorflow 并尝试打印我安装的版本。

import tensorflow as tf
print(tf.__version__)

当我收到这个“错误”时:

Module 'tensorflow' has no '__version__' member pylint (no-member)

我说错误是因为它将2.0.0 打印到终端,但 VSCode 仍然说文件中有错误。我认为这可能是 linter 的问题,但我已经安装了 pylint,这就是 TF recommends。

关于如何修复此错误的任何想法?在添加参数以禁用类似的错误之前,我希望知道是什么原因造成的。

【问题讨论】:

  • 对this有帮助吗,版本号是多少?
  • 版本为 2.0.0

标签: python tensorflow visual-studio-code pylint


【解决方案1】:

看起来我检查版本的方式不正确。取a look at the docs应该是:

import tensorflow as tf
print(tf.version.VERSION)

【讨论】:

    猜你喜欢
    • 2020-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-24
    • 1970-01-01
    相关资源
    最近更新 更多