【问题标题】:Running Tensorflow in Anaconda3在 Anaconda3 中运行 TensorFlow
【发布时间】:2021-01-12 12:02:35
【问题描述】:

我正在尝试在 Anaconda Navigator 中运行 Tensorflow。我将 Tensorflow 安装到了一个名为 tf.这是我的代码:

import tensorflow as tf

from tensorflow.keras import layers

from tensorflow.keras.layers import Activation, Dense

错误信息是unable to import tensorflowNo module named tensorflow

【问题讨论】:

  • conda list 输出什么?
  • 这里是部分列表:tensorboard 2.3.0 pyh4dce500_0 tensorboard-plugin-wit 1.6.0 py_0 tensorflow 2.3.0 mkl_py38h8c0d9a2_0 tensorflow-base 2.3.0 eigen_py38h75a453f_0 tensorflow-dataset 2.3.0 pyheb71bc4_0 张量流元数据 0.14.0 p
  • 你应该有这样的tensorboard 2.0.1 pypi_0 pypi
  • 我在里面没有看到类似的东西。
  • 那就试试conda install tensorflow

标签: tensorflow import anaconda


【解决方案1】:

按照这些步骤在 Anaconda 环境中安装。

#Set Up Anaconda Environments
conda create --name tf_env python=3.7
#Activate the new Environment
source activate tf_env
#Install tensorflow
tf_env$pip install tensorflow 
#Verify installation
tf_env$python
>import tensorflow as tf
>tf.__version__

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-17
    相关资源
    最近更新 更多