Jupyter 环境错误,加载与安装不同的 tensorflow 版本

Jupyter environment error, loading different tensorflow version than installed

我正在使用 ubuntu 20.04。我创建了一个新环境。

conda create -n tfgpu python=3.8 conda 激活 tfgpu pip 安装 tensorflow-gpu==2.3 jupyter 笔记本

然后我打开之前创建的 .ipynb 文件并尝试导入 tensorflow。 将 tensorflow 导入为 tf tf.版本

版本即将发布为 2.4.1 我在我的基本环境中安装了 tensorflow 2.4.1。即使它无关,我也卸载了它。我也在其他环境中检查了 tf 2.4.1,但找不到。当我在那个笔记本中写 !pip uninstall tensorflow 时,它说 Skipping as no tensorflow installed。当我写 !pip uninstall tensorflow-gpu 时,它卸载了 tensorflow==2.3。之后它仍然能够导入 2.4.1 版本的 tensorflow。我不明白发生了什么。我可以说我曾经也安装过 tf-nightly 但在不同的环境中。我认为这与安装路径有关,或者与环境名称有关。这真的很烦人,任何帮助表示赞赏。谢谢。

我错过了安装 jupyter notebook。我还不明白发生了什么,但我的错误就是这样。问题已解决。