如何在conda环境中安装Keras 2.0.5版本

4

我正在使用Windows 7 64位操作系统,并在使用Anaconda进行技术开发。

以下是我的操作步骤:

conda update conda
conda create --name my_env python=3.5
conda activate my_env
conda install -c conda-forge tensorflow=1.8

当我尝试安装keras 2.0.5时:
conda install keras=2.0.5

我收到了这条消息:

Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible so lve. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible so lve.

PackagesNotFoundError: The following packages are not available from current cha nnels:

  • keras=2.0.5

Current channels:

To search for alternate channels that may provide the conda package you're looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.

我也尝试过:

conda install -c conda-forge keras=2.0.5

使用前述相同的信息。

我已经检查过是否已安装Keras:

python -c "import keras; print(keras.__version__)"

出现以下错误信息:

ImportError: 找不到名为'keras'的模块

我搜索了keras包:

conda search keras

输出结果为:

# Name                       Version           Build  Channel
keras                          2.0.8  py35h15001cb_0  pkgs/main
keras                          2.0.8  py36h65e7a35_0  pkgs/main
keras                          2.1.2          py35_0  pkgs/main
keras                          2.1.2          py36_0  pkgs/main
keras                          2.1.3          py35_0  pkgs/main
keras                          2.1.3          py36_0  pkgs/main
keras                          2.1.4          py35_0  pkgs/main
keras                          2.1.4          py36_0  pkgs/main
keras                          2.1.5          py35_0  pkgs/main
keras                          2.1.5          py36_0  pkgs/main
keras                          2.1.6          py35_0  pkgs/main
keras                          2.1.6          py36_0  pkgs/main
keras                          2.2.0               0  pkgs/main
keras                          2.2.2               0  pkgs/main
keras                          2.2.4               0  pkgs/main
keras                          2.3.1               0  pkgs/main
keras                          2.4.3               0  pkgs/main

我该如何在我的环境中安装Keras 2.0.5版本?


1
似乎我们从未打包2.0.5版本。最简单的方法可能是使用pip进行安装。如果您确实需要一个conda软件包,您可以原则上在conda-forge/keras-feedstock中构建一个。 - cel
1个回答

5
您可以考虑使用pip进行安装,它在Conda环境中受支持。
使用以下命令:
pip install Keras==2.0.5

这段代码不会抛出任何错误。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接