Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在我的计算机上找到TensorFlow的版本?_Tensorflow - Fatal编程技术网

如何在我的计算机上找到TensorFlow的版本?

如何在我的计算机上找到TensorFlow的版本?,tensorflow,Tensorflow,在我的计算机上查找TensorFlow版本的命令是什么?我不久前在我的计算机上安装了TensorFlow,希望确保我拥有最新版本 import tensorflow as tf tf.__version__ 您可以通过将“tensorflow”替换为库名称来查找任何已安装库的版本。您可以尝试以下方法: $ pip show tensorflow Name: tensorflow Version: 1.5.0 Summary: TensorFlow helps the tensors flow

在我的计算机上查找TensorFlow版本的命令是什么?我不久前在我的计算机上安装了TensorFlow,希望确保我拥有最新版本

import tensorflow as tf
tf.__version__
您可以通过将“tensorflow”替换为库名称来查找任何已安装库的版本。

您可以尝试以下方法:

$ pip show tensorflow
Name: tensorflow
Version: 1.5.0
Summary: TensorFlow helps the tensors flow
pip freeze|grep tensorflow
$import tensorflow作为tf
$tf.test.u是用_cuda()构建的吗
真的
$tf.test.\u gpu\u是否可用(cuda\u only=False,min\u cuda\u compute\u capability=None)
假的

使用jupyter笔记本/Pycharm中的以下代码检查tensorflow版本

import tensorflow as tf

print(tf.version.VERSION)

这样做可能会遇到一个错误,上面写着“ImportError:无法导入名称pywrap\u tensorflow”。您可能只是从Tensorflow目录运行Python。只要切换到另一个目录,它就会工作。我们能看看是否安装了GPU/CPU版本吗?可能是重复的欢迎发布堆栈溢出。谢谢你的回答。但请尽量避免只回答代码(或命令)问题。当我使用tensorflow 2.4版在Ubuntu18.04的终端上打开Python3.8时,这也能起作用。
pip freeze|grep tensorflow
import tensorflow as tf

print(tf.version.VERSION)