I've got TensorFlow installed on my machine however I'm keep getting the error: UsageError: Line magic function `%tensorflow_version` not found.
Any ideas as to why this is? The code I ran is below (Jupyter Notebook)
%tensorflow_version 1.x
import tensorflow as tf
print(tf.__version__)
To check your TensorFlow version in your Jupyter Notebook such as Google's Colab, use the following two commands: import tensorflow as tf This imports the TensorFlow library and stores it in the variable named tf . print(tf. __version__) This prints the installed TensorFlow version number in the format x.y.z .
Jupyter notebook comes with a set of magic functions, but %tensorflow_version
is not one of them. The magic command
%tensorflow_version X.X
is only available in Google Colab notebooks, not Jupyter notebooks.
This code
%tensorflow_version 1.x
...is a "magic" command ("magic spell") in Google Colab that instructs the Colab environment to use the newest stable release of Tensorflow version 1. For you to get the code to work on your own Jupyter notebook, you'll need to install Tensorflow locally. There are a few ways:
command line, installing a particular version:
pip install tensorflow==1.15.0
or in your Jupyter notebook, itself:
import sys
!{sys.executable} -m pip install tensorflow==1.15.0
# !{sys.executable} -m pip install --user tensorflow==1.15.0. # you may need '--user' based on your environment
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With