本文介绍了UsageError:找不到行魔术函数`%tensorflow_version`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的机器上已经安装了TensorFlow,但我一直收到错误消息: UsageError:找不到行魔术函数`%tensorflow_version`.

I've got TensorFlow installed on my machine however I'm keep getting the error: UsageError: Line magic function `%tensorflow_version` not found.

关于这是为什么的任何想法?我运行的代码如下(Jupyter Notebook)

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__)

推荐答案

Jupyter笔记本带有一组魔术函数,但是%tensorflow_version 并不是其中之一.魔术命令

Jupyter notebook comes with a set of magic functions, but %tensorflow_version is not one of them. The magic command

%tensorflow_version X.X

仅在Google Colab笔记本中可用,而在Jupyter笔记本中不可用.

is only available in Google Colab notebooks, not Jupyter notebooks.

这篇关于UsageError:找不到行魔术函数`%tensorflow_version`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 19:25