我在一个名为tensorflow
的虚拟环境中使用tensorflow。在那里,我使用pip install tensorflow==2.2.0
安装了tensorflow 2.2.0。如果我列出环境中可用的包,它将列出tensorflow版本2.2.0
conda list|grep tensorflow
# packages in environment at /home/user/anaconda3/envs/tensorflow:
tensorflow 2.2.0 mkl_py37h6e9ce2d_0
tensorflow-base 2.2.0 mkl_py37hd506778_0 anaconda
tensorflow-estimator 2.2.0 pyh208ff02_0 anaconda
除此之外,我在ipython内核中注册了tensorflow
,如下所示:
python -m ipykernel install --user --name tensorflow --display-name "Python 3.7 (tensorflow)"
但是,当我尝试通过ipython
或juypter导入tensorflow时,如下所示
import tensorflow as tf
In [2]: print(f"Tensor Flow Version: {tf.__version__}")
...:
Tensor Flow Version: 1.14.0
版本为1.14.0 python、ipython和juypter都在我的环境中
(tensorflow) user@user-XPS-13-9370:~$ which python
/home/user/anaconda3/envs/tensorflow/bin/python
(tensorflow) user@user-XPS-13-9370:~$ which ipython
/home/user/anaconda3/envs/tensorflow/bin/ipython
(tensorflow) user@user-XPS-13-9370:~$which jupyter
/home/user/anaconda3/envs/tensorflow/bin/jupyter
非常感谢您的帮助/建议。 谢谢
目前没有回答
相关问题 更多 >
编程相关推荐