gpt4 book ai didi

python - 在 Anaconda 上安装带有 Tensorflow 后端的 Keras 时出现问题

转载 作者:行者123 更新时间:2023-12-01 02:42:07 24 4
gpt4 key购买 nike

我正在尝试在 Anaconda 上安装 keras、theano 和 tensorflow。以下是我遵循的步骤:步骤1:创建了一个环境“nnet”

conda create -nnnet python=3.5 anaconda

第 2 步:

activate nnet

第 3 步:在新环境中安装Spyder

conda install spyder

第 4 步:安装软件包

pip install theano
pip install tensorflow
pip install keras

第 5 步:更新所有包

conda update --all

第 6 步:在nnet环境下运行spyder

现在,当我运行尝试导入 keras 的代码时,出现此错误:

ImportError: Importing the multiarray numpy extension module failed. Most likely you are trying to import a failed build of numpy. If you're working with a numpy git repo, try git clean -xdf (removes all files not under version control). Otherwise reinstall numpy.

Original error was: DLL load failed: The specified module could not be found.

然后我卸载了 numpy 并重新安装。但是错误仍然存​​在。

此外,在检查 nnet 环境下 anaconda navigator 中安装的软件包时,我发现 tensorflow 和 theano 丢失。 Here is the list I am referring to

我之前已经使用过这些步骤,并且之前已经成功使用过这些包。(在代码中导入并使用)然而,我现在无法弄清楚这个问题。任何形式的帮助或指导将不胜感激。

最佳答案

我能够通过修改步骤 4 中的命令来解决该问题:

第 4 步:

conda install -c anaconda theano 
conda install -c conda-forge tensorflow
conda install -c conda-forge keras

这些包现在工作正常,我也可以导入它们。

关于python - 在 Anaconda 上安装带有 Tensorflow 后端的 Keras 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45573930/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com