在 python 3.7 中显示 tensorflow 2.4.1 的版本

Show version of tensorflow 2.4.1 in python 3.7

使用python 3.7,如果你有tensorflow 2.4.1,你如何打印tensorflow的版本。 None 的记录样式:'tf. __ version__'、tf.version 和 tf.version。VERSION 似乎有效。

这个似乎对我有用:

tf.__version__

运行 在 Colab Notebook 中使用 Python 3.7.10 和 Tensorflow 2.4.1

或者,如果您使用 pip 安装 Tensorflow,您还可以使用:

pip show tensorflow