python-tensorflowHow can I check the version of Python, Tensorflow, and Numpy I am using?
To check the version of Python, Tensorflow, and Numpy you are using, you can use the following code:
import sys
import tensorflow as tf
import numpy as np
print("Python version:", sys.version)
print("Tensorflow version:", tf.__version__)
print("Numpy version:", np.__version__)
Output example
Python version: 3.7.6 (default, Jan 8 2020, 19:59:22)
[GCC 7.3.0]
Tensorflow version: 2.1.0
Numpy version: 1.18.1
The code consists of three parts:
import sys
imports thesys
module, which contains system-specific parameters and functions.import tensorflow as tf
imports the Tensorflow library and assigns it to thetf
alias.import numpy as np
imports the Numpy library and assigns it to thenp
alias.
The following three lines print the version of Python, Tensorflow, and Numpy respectively:
print("Python version:", sys.version)
print("Tensorflow version:", tf.__version__)
print("Numpy version:", np.__version__)
For more information on how to check the version of Python, Tensorflow, and Numpy, please refer to this page.
More of Python Tensorflow
- How can I use Python and TensorFlow to handle illegal hardware instructions in Zsh?
- How can I use YOLOv3 with Python and TensorFlow?
- ¿Cómo implementar reconocimiento facial con TensorFlow y Python?
- How can I use Tensorflow 1.x with Python 3.8?
- How do I check which version of TensorFlow I am using with Python?
- How do I resolve a SymbolAlreadyExposedError when the symbol "zeros" is already exposed as () in TensorFlow Python util tf_export?
- How do I resolve the "ImportError: cannot import name 'batchnormalization' from 'tensorflow.python.keras.layers'" error in software development?
- How can I use Python and TensorFlow to implement YOLO object detection?
- How can I use Python and TensorFlow to implement YOLOv4?
- How can I use TensorFlow with Python 3.11?
See more codes...