在Conda环境中安装Tensorflow

时间:2020-09-24 08:52:35

标签: python tensorflow ubuntu anaconda jupyter-lab


我在安装Tensorflow(Tf)时遇到问题。首先,从终端安装Tensorflow到conda环境。我在终端上导入了Tensorflow

python
import tensorflow as tf

有效。然后我打开了jupyter Lab,将内核设置为我的环境。而且我尝试导入Tf,但失败了。

我按如下方式安装了Tf;

conda install tensorflow-gpu==1.10.0

conda list

输出如下:

# Name                    Version                   Build  Channel

tensorboard               1.10.0           py35hf484d3e_0    defaults 
tensorflow                1.10.0          gpu_py35h566a776_0    defaults 
tensorflow-base           1.10.0          gpu_py35h6ecc378_0    defaults 
tensorflow-gpu            1.10.0               hf154084_0    defaults

配置:
Anaconda3
Python:3.5
操作系统:Ubuntu 16.04

编辑:

ImportError                               Traceback (most recent call last)
<ipython-input-1-fec9a2f62822> in <module>()
----> 1 import tensorflow as tf
      2 slim = tf.contrib.slim
      3 import numpy as np
      4 from IPython.display import clear_output
      5 from sklearn.model_selection import train_test_split

ImportError: No module named 'tensorflow'

0 个答案:

没有答案