Skip to content Skip to sidebar Skip to footer

Usageerror: Line Magic Function `%tensorflow_version` Not Found

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 co

Solution 1:

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.

Solution 2:

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

Post a Comment for "Usageerror: Line Magic Function `%tensorflow_version` Not Found"