我刚刚安装了Tensorflow,并尝试打印我安装的版本。
import tensorflow as tf
print(tf.__version__)
当我遇到这个“错误”时:
Module 'tensorflow' has no '__version__' member pylint (no-member)
我说错误是因为它将2.0.0
打印到终端,但是VSCode仍然说文件中有错误。我认为这可能与短绒棉有关,但是我已经安装了TF recommends。{p}
关于如何解决此错误的任何想法?在添加参数以禁用此类错误之前,我更想知道是什么原因造成的。
答案 0 :(得分:1)
看起来像我检查版本不正确的方式。取a look at the docs应该是:
import tensorflow as tf
print(tf.version.VERSION)