繁体   English   中英

在 Anaconda 环境中安装 AutoSKLearn

[英]Installing AutoSKLearn in Anaconda Environment

我正在尝试在 anaconda 环境AutoSKLearn 中安装 autosklearn ,之后我使用 jupyter notebook 并尝试import autosklearn.classification但我收到此错误,“ValueError: numpy.ufunc size changed,可能表示二进制不兼容。预计来自 C 头的 216 ,从 PyObject 得到 192”。 我该如何解决这个错误?

这里解释一切。

蟒蛇安装
Anaconda 不提供 auto-sklearn,也没有用于 auto-sklearn 的 conda 包。 因此,按照安装 auto-sklearn 部分中的详细说明安装 auto-sklearn 是最简单的。

最近 Linux 发行版下的一个常见安装问题是用于编译 AnaConda 提供的 Python 二进制文件的编译器版本与发行版安装的编译器不兼容。 这可以通过安装 AnaConda(以及 swig)附带的 gcc 编译器来解决:

conda install gxx_linux-64 gcc_linux-64 swig

根据 autosklearn 文档,它不会在 Windows 上正式支持,

auto-sklearn relies heavily on the Python module resource. resource is part of Python’s Unix Specific Services and not available on a Windows machine. Therefore, it is not possible to run auto-sklearn on a Windows machine.

Possible solutions (not tested):

Windows 10 bash shell

virtual machine

docker image

**** 如何在 Mac OS Big Sur 11.2.1 和 gcc 10.2.04 上安装 auto-sklearn 和 pyrtr ****

这就是我在 Mac OS Big Sur 上成功安装 auto-sklearn 的方式,在 Anaconda 3 下

瓶颈是使用最新的 gcc 编译器来安装 pyrfr,它是 auto-sklearn 的一个依赖项,以及其他一些东西。 在 Mac OS 上,C++ 和开发工具是用 xcode-select 安装的,C++ 编译器的默认版本不是我们需要的(参考这个线程):

gcc --version

默认是 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

首先,确保所有内容都已更新:

xcode-select --install

brew 更新 brew 升级 brew 信息 gcc brew 安装 gcc brew 清理 brew 医生

并更新 conda,以防万一:

conda update -n 基础 conda conda update --all

(“conda install gcc”对我不起作用,就像某些线程建议的那样,“conda config --set restore_free_channel true”也没有帮助)如果“冻结”

conda update -prefix /opt/anaconda3 anaconda

但是“brew install gcc”为我安装了gcc,现在我们只需要在~/.zshrc(或者~/.bash_profile或~/.bashrc,如果你还没有切换到zsh,这是默认的)做一个别名在较新的 Mas 操作系统中)

brew gcc info gcc: stable 10.2.0 (bottled), HEAD GNU 编译器集合https://gcc.gnu.org/ /usr/local/Cellar/gcc/10.2.0_4

建议,我的 gcc 现在在 /usr/local/Cellar/gcc/10.2.0_4/bin/gcc-10 检查:/usr/local/Cellar/gcc/10.2.0_4/bin/gcc-10 -v

制作别名:

vi ~/.zshrc 添加别名 alias gcc="/usr/local/Cellar/gcc/10.2.0_4/bin/gcc-10" source ~/.zshrc

现在,继续安装:

brew install swig pip install lazy-import pip install pyrfr --no-cache-dir pip install auto-sklearn --no-cache-dir

完毕!

也许,这有帮助:

pip 卸载 pyrfr auto-sklearn curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip install CC=/usr/local/Cellar/gcc/10.2.0_4/bin/gcc-10 pip install lazy-import pyrfr auto-sklearn --no-cache-dir

或者,如果您设法在 Anaconda3 中安装了 gcc:

pip 卸载 pyrfr auto-sklearn curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip install CC=/Users//opt/anaconda3/bin/gccpip install pyrfr auto-sklearn --no-cache-dir

也许,你需要重新安装 auto-sklearn,然后

pip install autosklearn --no-cache-dir --force-reinstall -I --no-deps --upgrade

可能有助于到达那里的其他资源: https : //medium.com/@dvdasari/install-latest-gcc-on-mac-os-x-b4ce9a66a184 http://www-scf.usc.edu/~csci104 /installation/gccmac.html https://github.com/automl/auto-sklearn/issues/155

尝试: conda install -c conda-forge auto-sklearn

https://anaconda.org/conda-forge/auto-sklearn

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM