如何导入特定版本的tensorflow?
How to import a specific version of tensorflow?
我想使用安装在我的 virtualenv 中的 tensorflow 版本 1.0.0。
我正在我的 jupyter notebook 中导入 tensorflow,但只导入了全局 tensorflow 版本。
如何将tensorflow的版本导入我安装在virtualenv中的jupyter notebook?
为了社区.
的利益,尽管它出现在评论部分(感谢@jdehesa),但还是在此处(回答部分)提供了解决方案
当我们有多个 Virtual Environments
并且每个 Virtual Environment
都有不同版本的 Tensorflow
时,为了使用特定的 Tensorflow Version
,我们必须 激活各自的Virtual Environment
.
激活 Virtual Environment
使用 Conda
不同 Operating Systems
的命令如下所示:
# Activate the Virtual Environment. Conda Version > 4.6 and Windows OS
conda activate TF_2_VE
# Activating Virtual Environment, Conda Version < 4.6 and Windows OS
activate TF_2_VE
# Activating Virtual Environment, Conda Version < 4.6 and Linux and Mac OS
source activate TF_2_VE
要了解如何使用Python
激活一个Virtual Environment
,请参阅此Stack Overflow Issue。
我想使用安装在我的 virtualenv 中的 tensorflow 版本 1.0.0。
我正在我的 jupyter notebook 中导入 tensorflow,但只导入了全局 tensorflow 版本。
如何将tensorflow的版本导入我安装在virtualenv中的jupyter notebook?
为了社区.
的利益,尽管它出现在评论部分(感谢@jdehesa),但还是在此处(回答部分)提供了解决方案当我们有多个 Virtual Environments
并且每个 Virtual Environment
都有不同版本的 Tensorflow
时,为了使用特定的 Tensorflow Version
,我们必须 激活各自的Virtual Environment
.
激活 Virtual Environment
使用 Conda
不同 Operating Systems
的命令如下所示:
# Activate the Virtual Environment. Conda Version > 4.6 and Windows OS
conda activate TF_2_VE
# Activating Virtual Environment, Conda Version < 4.6 and Windows OS
activate TF_2_VE
# Activating Virtual Environment, Conda Version < 4.6 and Linux and Mac OS
source activate TF_2_VE
要了解如何使用Python
激活一个Virtual Environment
,请参阅此Stack Overflow Issue。